-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Beitrag Lucas #1
base: main
Are you sure you want to change the base?
Conversation
// Act: Versuche, einen neuen TimelogType mit ungültigen Daten zu erstellen | ||
var result = controller.CreateTimelogType(invalidTimelogType); | ||
|
||
//Todo: Assert: Überprüfe, ob das Ergebnis ein BadRequestObjectResult ist und die Fehlermeldung enthält |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kein Assert
// Assert: Überprüfe, ob das Ergebnis vom korrekten Typ ist und die erwartete Anzahl an Elementen enthält.// Assert | ||
var viewResult = Assert.IsType<ActionResult<List<TimelogTypeResponse>>>(result); | ||
var model = Assert.IsAssignableFrom<List<TimelogTypeResponse>>(viewResult.Value); | ||
Assert.Equal(6, model.Count()); // Es werden 5 Elemente erwartet plus das eine Element was im CreateTimelogType_Validation_Fails_ForInvalidData() erstellt wird. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Abhängigkeit zu anderen Tests
public string timelogType { get; set; } | ||
|
||
// Budget muss grösser oder gleich 0 sein | ||
[Range(0, double.MaxValue, ErrorMessage = "Das Zeitbudget darf nicht negativ ")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Datatypen validierung, super!
No description provided.