Beispiel #1
0
 public void CreateCategoryShouldFailWithForbidden(string role, CreateCategoryFixture fixture)
 {
     $"Given the user is authenticated and has the {role} role".x(() => fixture.GivenTheUserIsAuthenticatedAndHasRole(role));
     "And an existing menu".x(fixture.GivenAnExistingMenu);
     "And the category being created does not exist in the menu".x(fixture.GivenTheCategoryDoesNotExist);
     "When a new category is submitted".x(fixture.WhenTheCategoryIsSubmitted);
     "Then a Forbidden response is returned".x(fixture.ThenAForbiddenResponseIsReturned);
     "And the menu is not persisted to the storage".x(fixture.ThenTheMenuShouldNotBePersisted);
     "And the event MenuUpdate is NOT Raised".x(fixture.ThenAMenuUpdatedEventIsNotRaised);
     "And the event CategoryCreated is NOT Raised".x(fixture.ThenACategoryCreatedEventIsNotRaised);
 }
Beispiel #2
0
 public void CreateCategoryShouldFailWhenMenuDoesNotExist(string role, CreateCategoryFixture fixture)
 {
     $"Given the user is authenticated and has the {role} role".x(() => fixture.GivenTheUserIsAuthenticatedAndHasRole(role));
     "And a menu does not exist".x(fixture.GivenAMenuDoesNotExist);
     "When a new category is submitted".x(fixture.WhenTheCategoryIsSubmitted);
     "Then a failure response is returned".x(fixture.ThenAFailureResponseIsReturned);
     "And the response code is NotFound".x(fixture.ThenANotFoundResponseIsReturned);
     "And the menu is loaded from the storage".x(fixture.ThenMenuIsLoadedFromStorage);
     "And the menu is not persisted to the storage".x(fixture.ThenTheMenuShouldNotBePersisted);
     "And the event MenuUpdate should NOT be raised".x(fixture.ThenAMenuUpdatedEventIsNotRaised);
     "And the event CategoryCreated should not be Raised".x(fixture.ThenACategoryCreatedEventIsNotRaised);
 }
Beispiel #3
0
 public void CreateCategoryShouldFailWhenCategoryAlreadyExists(string role, CreateCategoryFixture fixture)
 {
     $"Given the user is authenticated and has the {role} role".x(() => fixture.GivenTheUserIsAuthenticatedAndHasRole(role));
     "And an existing menu".x(fixture.GivenAnExistingMenu);
     "And the menu belongs to the user restaurant".x(fixture.GivenTheMenuBelongsToUserRestaurant);
     "And the category being created already exist in the menu".x(fixture.GivenTheCategoryAlreadyExist);
     "When a new category is submitted".x(fixture.WhenTheCategoryIsSubmitted);
     "Then a failure response is returned".x(fixture.ThenAFailureResponseIsReturned);
     "And the response code is Conflict".x(fixture.ThenAConflictResponseIsReturned);
     "And the menu is NOT persisted to the storage".x(fixture.ThenTheMenuShouldNotBePersisted);
     "And the event MenuUpdate should NOT be raised".x(fixture.ThenAMenuUpdatedEventIsNotRaised);
     "And the event CategoryCreated is NOT Raised".x(fixture.ThenACategoryCreatedEventIsNotRaised);
 }
Beispiel #4
0
 public void CreateCategoryShouldSucceed(string role, CreateCategoryFixture fixture)
 {
     $"Given the user is authenticated and has the {role} role".x(() => fixture.GivenTheUserIsAuthenticatedAndHasRole(role));
     "And an existing menu".x(fixture.GivenAnExistingMenu);
     "And the menu belongs to the user restaurant".x(fixture.GivenTheMenuBelongsToUserRestaurant);
     "And the category being created does not exist in the menu".x(fixture.GivenTheCategoryDoesNotExist);
     "When a new category is submitted".x(fixture.WhenTheCategoryIsSubmitted);
     "Then a successful response is returned".x(fixture.ThenASuccessfulResponseIsReturned);
     "And the menu is loaded from the storage".x(fixture.ThenMenuIsLoadedFromStorage);
     "And the id of the new category is returned".x(fixture.ThenTheResourceCreatedResponseIsReturned);
     "And the category is added to the menu".x(fixture.ThenTheCategoryIsAddedToMenu);
     "And the menu is persisted to the storage".x(fixture.ThenTheMenuShouldBePersisted);
     "And the event MenuUpdate is Raised".x(fixture.ThenAMenuUpdatedEventIsRaised);
     "And the event CategoryCreated is Raised".x(fixture.ThenACategoryCreatedEventIsRaised);
 }