Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Fact]
- public void CreateGetShouldHaveRestrictionsForHttpGetOnlyAndAuthorizedUsersAndShouldReturnView()
- => MyController<ArticlesController> // Specify the controller under test.
- .Instance() // Create it from the globally registered services.
- .Calling(c => c.Create()) // Specify the action under test.
- .ShouldHave()
- .ActionAttributes(attrs => attrs // Assert action attributes.
- .RestrictingForHttpMethod(HttpMethod.Get)
- .RestrictingForAuthorizedRequests())
- .AndAlso() // Provide additional assertions.
- .ShouldReturn()
- .View(); // Validate the view result.
Advertisement
Add Comment
Please, Sign In to add comment