コード例 #1
0
 public void GetShouldHaveAuthorizedAttribute()
 {
     MyWebApi
     .Controller <CategoriesController>()
     .WithResolvedDependencyFor(TestObjectFactory.GetCategoriesService())
     .Calling(c => c.Post(TestObjectFactory.GetValidCategoryModel()))
     .ShouldHave()
     .ActionAttributes(attr => attr.RestrictingForAuthorizedRequests());
 }
コード例 #2
0
 public void PostShouldValidateModelState()
 {
     MyWebApi
     .Controller <CategoriesController>()
     .WithResolvedDependencyFor(TestObjectFactory.GetCategoriesService())
     .Calling(c => c.Post(TestObjectFactory.GetValidCategoryModel()))
     .ShouldHave()
     .ValidModelState();
 }