BillableHoursWebApp.Api.Tests.ControllerTests.CategoriesControllerTests.ReturnBadRequestPostActionWithValidModelStateButDuplicateName C# (CSharp) Method

ReturnBadRequestPostActionWithValidModelStateButDuplicateName() private method

        public void ReturnBadRequestPostActionWithValidModelStateButDuplicateName()
        {
            this.controller
                .Calling(c => c.Post(new CategoryRequestModel { Name = "Mock Category" }))
                .ShouldHave()
                .ActionAttributes(attr => attr.RestrictingForAuthorizedRequests())
                .AndAlso()
                .ShouldReturn()
                .BadRequest()
                .WithErrorMessage("A category with that name exists already!");
        }