public void RemoveShouldUpdateLastModifiedTime() { var sut = new PrivateRecipe(_author, _title); var recipeItem1 = new RecipeItem(_itemDescription, sut); var recipeItem2 = new RecipeItem(_itemDescription, sut); sut.Add(recipeItem1); sut.Add(recipeItem2); var oldTime = sut.TimeLastModified; Thread.Sleep(100); sut.Remove(recipeItem1); var newTime = sut.TimeLastModified; newTime.ShouldNotEqual(oldTime); }
public void RemoveShouldRemoveItem() { var sut = new PrivateRecipe(_author, _title); var recipeItem1 = new RecipeItem(_itemDescription, sut); var recipeItem2 = new RecipeItem(_itemDescription, sut); sut.Add(recipeItem1); sut.Add(recipeItem2); sut.Remove(recipeItem1); sut.Items.Count.ShouldEqual(1); sut.Items[0].ShouldBeSameAs(recipeItem2); }