public void ShouldBeAbleToAddItems() { var order = new Order(); var item = new MockOrderItem(); order.Add(item); Assert.Contains(item, order.Items); }
public void AddedOrderItemsAppearInItemsProperty() { var order = new Order(); var item = new MockOrderItem(); order.Add(item); Assert.Contains(item, order.Items); }
public void ShouldBeAbleToRemoveItems() { var order = new Order(); var item = new MockOrderItem(); order.Add(item); order.Remove(item); Assert.DoesNotContain(item, order.Items); }
public void RemovedOrderItemDoesNotAppearInItemsProperty() { var order = new Order(); var item = new MockOrderItem(); order.Add(item); order.Remove(item); Assert.DoesNotContain(item, order.Items); }
public void RemovingAnItemShouldTriggerPropertyChanged(string propertyName) { var order = new Order(); var item = new MockOrderItem(); Assert.PropertyChanged(order, propertyName, () => { order.Remove(item); }); }
public void ShouldBeAbleToGetEnumerationOfItems() { var order = new Order(); var item0 = new MockOrderItem(); var item1 = new MockOrderItem(); var item2 = new MockOrderItem(); order.Add(item0); order.Add(item1); order.Add(item2); Assert.Collection(order.Items, item => Assert.Equal(item0, item), item => Assert.Equal(item1, item), item => Assert.Equal(item2, item)); }