Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Fact]
- public void CreatePostShouldHaveRestrictionsForHttpPostOnlyAndAuthorizedUsers()
- => MyController<ArticlesController> // Specify the controller under test.
- .Instance() // Create it from the globally registered services.
- .Calling(c => c.Create(With.Empty<ArticleFormModel>())) // Specify the action under test and provide empty model.
- .ShouldHave()
- .ActionAttributes(attrs => attrs // Assert action attributes.
- .RestrictingForHttpMethod(HttpMethod.Post)
- .RestrictingForAuthorizedRequests());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement