public void SizeCreatedEvent_should_create_deactivated_stockItem_if_isActive_is_false() { var @event = new SizeCreatedEvent("Widget", "Small", false); StockItem stockItem = null; stockItemRepository.SaveOrUpdateDelegate = x => stockItem = x; createStockItemOnSizeCreatedEvent.Handle(@event); stockItem.IsActive.ShouldBeFalse(); }
public void SizeCreatedEvent_should_create_new_StockItem() { const string productName = "Widget"; const string sizeName = "Small"; var @event = new SizeCreatedEvent(productName, sizeName, true); StockItem stockItem = null; stockItemRepository.SaveOrUpdateDelegate = x => stockItem = x; createStockItemOnSizeCreatedEvent.Handle(@event); stockItem.ShouldNotBeNull(); stockItem.ProductName.ShouldEqual("Widget"); stockItem.SizeName.ShouldEqual("Small"); stockItem.IsActive.ShouldBeTrue(); stockItem.History[0].DateTime.ShouldEqual(now); stockItem.History[0].User.ShouldEqual(user); }