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