public async Task SuccessfulCreationSetsSuccessMessage(SliceFixture fixture) { // Arrange var controller = fixture.GetController <CategoryController>(); // Act var createCommand = new Create.Command { Name = "Some category" }; await controller.Create(createCommand); // Assert controller.TempData .ShouldContainSuccessMessage(SuccessMessages.SuccessfullyCreatedCategory(createCommand.Name)); }
public async Task SuccessfullRemoveSetsSuccessMessage(SliceFixture fixture) { // Arrange var category = AddCategoryToDatabase(fixture); var controller = fixture.GetController <CategoryController>(); // Act var removeCommand = new Remove.Command { Id = category.Id }; await controller.Remove(removeCommand); // Assert controller.TempData .ShouldContainSuccessMessage(SuccessMessages.SuccessfullyRemovedCategory(removeCommand.Name)); }
public async Task SuccessfullEditSetsSuccessMessage(SliceFixture fixture) { // Arrange var category = AddCategoryToDatabase(fixture); var controller = fixture.GetController <CategoryController>(); // Act var editCommand = new Edit.Command { Id = category.Id, Name = "Edited name" }; await controller.Edit(editCommand); // Assert controller.TempData .ShouldContainSuccessMessage(SuccessMessages.SuccessfullyEditedCategory(editCommand.Name)); }
public void SuccessfullCreationSetsSuccessMessage(SliceFixture fixture) { // Arrange var controller = fixture.GetController <RoleController>(); // Act var createCommand = new Create.Command { Name = "Some role" }; controller.Create(createCommand); // Assert controller.TempData .ShouldContainSuccessMessage(SuccessMessages.SuccessfullyCreatedRole(createCommand.Name)); }
public async Task SuccessfullRemoveSetsSuccessMessage(SliceFixture fixture) { // Arrange var product = AddProductToDatabase(fixture); var controller = fixture.GetController <ProductController>(); // Act var removeCommand = new Remove.Command { ProductId = product.Id }; await controller.Remove(removeCommand); // Assert controller.TempData .ShouldContainSuccessMessage(SuccessMessages.SuccessfullyRemovedProduct(removeCommand.ProductId)); }
public async Task SuccessfullRemovalSetsSuccessMessage(SliceFixture fixture) { // Arrange var controller = fixture.GetController <RoleController>(); var role = AddRoleToDb(fixture); // Act var removeCommand = new Remove.Command { RoleId = role.Id }; await controller.Remove(removeCommand); // Assert controller.TempData .ShouldContainSuccessMessage(SuccessMessages.SuccessfullyDeletedRole(role.Id)); }
public async Task SuccessfullEditSetsSuccessMessage(SliceFixture fixture) { // Arrange var controller = fixture.GetController <RoleController>(); var role = AddRoleToDb(fixture); // Act var editCommand = new Edit.Command { Name = "Edited name" }; await controller.Edit(editCommand); // Assert controller.TempData .ShouldContainSuccessMessage(SuccessMessages.SuccessfullyEditedRole(editCommand.Name)); }
public async Task SuccessfullEditSetsSuccessMessage(SliceFixture fixture) { // Arrange var product = await AddProductToDatabase(fixture); var controller = fixture.GetController <ProductController>(); // Act var editCommand = new Edit.Command { Id = product.Id, Name = "Edited name" }; await controller.Edit(editCommand); controller.TempData .ShouldContainSuccessMessage(SuccessMessages.SuccessfullyEditedProduct(editCommand.Name)); }
public async Task SuccessfullCreationSetsSuccessMessage(SliceFixture fixture) { // Arrange var controller = fixture.GetController <ProductController>(); // Act var createCommand = new Create.Command() { Name = "Some product", Description = "Some description", Category = new Data.Models.Category() { Name = "Some category" }, Price = 120.00m }; await controller.Create(createCommand); // Assert controller.TempData .ShouldContainSuccessMessage(SuccessMessages.SuccessfullyCreatedProduct(createCommand.Name)); }