public void CreateMenuAsNonAdminForValidMenuShouldFail(string role, CreateMenuFixture fixture) { $"As {role}".x(() => fixture.AsRole(role)); "Given a valid menu being submitted".x(fixture.GivenAValidMenu); "And the menu does not does not exist".x(fixture.GivenAMenuDoesNotExist); "When the menu is submitted".x(fixture.WhenTheMenuCreationIsSubmitted); "Then a Forbidden response is returned".x(fixture.ThenAForbiddenResponseIsReturned); "And the menu is not submitted to the database".x(fixture.ThenTheMenuIsNotSubmittedToDatabase); $"And an event of type {typeof(MenuCreated).Name} should not be raised".x(fixture.ThenAMenuCreatedEventIsNotRaised); }
public void CreateMenuAsAdminForInvalidMenuShouldFail(CreateMenuFixture fixture) { "As Admin".x(fixture.AsAdmin); "Given a valid menu being submitted".x(fixture.GivenAInvalidMenu); "And the menu does not does not exist".x(fixture.GivenAMenuDoesNotExist); "When the menu is submitted".x(fixture.WhenTheMenuCreationIsSubmitted); "Then a failure response is returned".x(fixture.ThenAFailureResponseIsReturned); "And the menu is not submitted to the database".x(fixture.ThenTheMenuIsNotSubmittedToDatabase); $"And an event of type {typeof(MenuCreated).Name} should not be raised".x(fixture.ThenAMenuCreatedEventIsNotRaised); }
public void CreateMenuAsAdminForInvalidMenuShouldFail(CreateMenuFixture fixture) { "Given the user is authenticated and has the Admin role".x(() => fixture.GivenTheUserIsAnAuthenticatedAdministrator()); "And a valid menu being submitted".x(fixture.GivenAInvalidMenu); "And the menu does not does not exist".x(fixture.GivenAMenuDoesNotExist); "When the menu is submitted".x(fixture.WhenTheMenuCreationIsSubmitted); "Then a failure response is returned".x(fixture.ThenAFailureResponseIsReturned); "And the menu is not submitted to the database".x(fixture.ThenTheMenuIsNotSubmittedToDatabase); $"And an event of type {nameof(MenuCreated)} should not be raised".x(fixture.ThenAMenuCreatedEventIsNotRaised); }
public void CreateMenuAsAdminForValidMenuShouldSucceed(CreateMenuFixture fixture) { "As Admin".x(fixture.AsAdmin); "Given a valid menu being submitted".x(fixture.GivenAValidMenu); "And the menu does not does not exist".x(fixture.GivenAMenuDoesNotExist); "When the menu is submitted".x(fixture.WhenTheMenuCreationIsSubmitted); "Then a successful response is returned".x(fixture.ThenASuccessfulResponseIsReturned); "And the response code is CREATED".x(fixture.ThenACreatedResponseIsReturned); "And the id of the new menu is returned".x(fixture.ThenTheResourceCreatedResponseIsReturned); "And the menu data is submitted correctly to the database".x(fixture.ThenTheMenuIsSubmittedToDatabase); $"And an event of type {typeof(MenuCreated).Name} is raised".x(fixture.ThenAMenuCreatedEventIsRaised); }
public void CreateMenuAsAdminForValidMenuShouldSucceed(CreateMenuFixture fixture) { "Given the user is authenticated and has the Admin role".x(() => fixture.GivenTheUserIsAnAuthenticatedAdministrator()); "And a valid menu being submitted".x(fixture.GivenAValidMenu); "And the menu does not does not exist".x(fixture.GivenAMenuDoesNotExist); "When the menu is submitted".x(fixture.WhenTheMenuCreationIsSubmitted); "Then a successful response is returned".x(fixture.ThenASuccessfulResponseIsReturned); "And the response code is CREATED".x(fixture.ThenACreatedResponseIsReturned); "And the id of the new menu is returned".x(fixture.ThenTheResourceCreatedResponseIsReturned); "And the menu data is submitted correctly to the database".x(fixture.ThenTheMenuIsSubmittedToDatabase); $"And an event of type {nameof(MenuCreated)} is raised".x(fixture.ThenAMenuCreatedEventIsRaised); }