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