public void WhenDeletingNonExistingItem_ShouldThrowEx() { //Arrange Perfume perfume1 = new Perfume("Santal"); StockManager manager = new StockManager(); //Act Action func = () => manager.DeletePerfume(perfume1); //Assert func.ShouldThrow <Exception>(); }
public void WhenDeletingLastItemFromStock_StockWasUpdated() { //Arrange Perfume perfume1 = new Perfume("Santal"); StockManager manager = new StockManager(); manager.AddPerfume(perfume1); //Act manager.DeletePerfume(perfume1); //Assert manager.IsPerfumeInStock("Santal").ShouldBeFalse(); }
public void WhenDeletingAPerfumeWIthBigStock_StockWasDecreased() { //Arrange Perfume perfume1 = new Perfume("Santal"); Perfume perfume2 = new Perfume("Santal"); StockManager manager = new StockManager(); manager.AddPerfume(perfume1); manager.AddPerfume(perfume2); //Act manager.DeletePerfume(perfume2); //Assert manager.IsPerfumeInStock("Santal").ShouldBeTrue(); }