public Document2 Create(int pagesCount)
        {
            Document2 result = new Document2(pagesCount);

            _dependencyInjector.InjectDependencies(result);
            return(result);
        }
Exemple #2
0
        public void Publish_should_calculate_totalCost()
        {
            IWindsorContainer windsorContainer = new WindsorContainer();

            windsorContainer.Register(Component.For <IDependencyInjector>().ImplementedBy <DependencyInjector>());
            windsorContainer.Register(Component.For <IDocumentFactory>().ImplementedBy <DocumentFactory>());
            windsorContainer.Register(Component.For <ICostCalculatorPolicy>().UsingFactoryMethod(CostCalculatorFactory.Create));
            windsorContainer.Register(Component.For <IWindsorContainer>().Instance(windsorContainer));

            Document2 document = windsorContainer.Resolve <IDocumentFactory>().Create(10);

            Assert.DoesNotThrow(() => document.Publish());

            //_repository.Save(document);
        }