Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Fact]
- public void CreatePostShouldReturnViewWithSameModelWhenInvalidModelState()
- => MyController<ArticlesController> // Specify the controller under test.
- .Instance() // Create it from the globally registered services.
- .Calling(c => c.Create(With.Default<ArticleFormModel>())) // Specify the action under test and provide empty model.
- .ShouldHave()
- .InvalidModelState() // Assert invalid model state.
- .AndAlso() // Provide additional assertions.
- .ShouldReturn()
- .View(With.Default<ArticleFormModel>()); // Validate the view result and the same empty model.
Advertisement
Add Comment
Please, Sign In to add comment