Open
Conversation
AlCaponi
commented
May 17, 2024
| // 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 |
AlCaponi
commented
May 17, 2024
| // 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. |
Collaborator
Author
There was a problem hiding this comment.
Abhängigkeit zu anderen Tests
AlCaponi
commented
May 17, 2024
| public string timelogType { get; set; } | ||
|
|
||
| // Budget muss grösser oder gleich 0 sein | ||
| [Range(0, double.MaxValue, ErrorMessage = "Das Zeitbudget darf nicht negativ ")] |
Collaborator
Author
There was a problem hiding this comment.
Datatypen validierung, super!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.