public void ShouldNotifyWhenSaved() { var orderNotifierMock = new OrderNotifierMock(); var orderService = new OrderServiceWithDependencyInjection(orderNotifierMock); orderService.Save(new Order()); orderNotifierMock.WasCalled.Should().BeTrue(); }
public void WithManualDecorator() { var orderService = new OrderServiceWithDependencyInjection(new LoggedOrderNotifierDecorator(new EMailOrderNotifier())); orderService.Save(new Order()); }
public void WithDependencyInjection() { var orderService = new OrderServiceWithDependencyInjection(new EMailOrderNotifier()); orderService.Save(new Order()); }