예제 #1
0
        public void ShouldNotifyWhenSaved()
        {
            var orderNotifierMock = new OrderNotifierMock();
            var orderService      = new OrderServiceWithDependencyInjection(orderNotifierMock);

            orderService.Save(new Order());

            orderNotifierMock.WasCalled.Should().BeTrue();
        }
예제 #2
0
        public void WithManualDecorator()
        {
            var orderService = new OrderServiceWithDependencyInjection(new LoggedOrderNotifierDecorator(new EMailOrderNotifier()));

            orderService.Save(new Order());
        }
예제 #3
0
        public void WithDependencyInjection()
        {
            var orderService = new OrderServiceWithDependencyInjection(new EMailOrderNotifier());

            orderService.Save(new Order());
        }