public FuelReportTestObjectsContainer(UnitOfWorkScope unitOfWorkScope)
        {
            this.UnitOfWorkScope = unitOfWorkScope;

            var basicInfoDomainServiceObjects = new BasicInfoDomainServiceObjectsContainer(unitOfWorkScope);
            var scrapTestObjects = new ScrapTestObjectsContainer(this.UnitOfWorkScope);

            this.FuelReportConfigurator = new FuelReportConfigurator(new FuelReportStateFactory(),null,null);

            this.FuelReportRepository = new FuelReportRepository(this.UnitOfWorkScope, this.FuelReportConfigurator);

            var currencyRepository = new EFRepository<Currency>(this.UnitOfWorkScope);

            var currencyDomainService = new CurrencyDomainService(currencyRepository);

            this.VoyageDomainService = new VoyageDomainService(new VoyageRepository(this.UnitOfWorkScope), FuelReportRepository);

            this.VoyageLogDomainService = new VoyageLogDomainService(new VoyageLogRepository(this.UnitOfWorkScope));

            var inventoryOperationFactory = new InventoryOperationFactory();

            var inventoryOperationRepository = new InventoryOperationRepository(this.UnitOfWorkScope);
            var inventoryOperationDomainService = new InventoryOperationDomainService(inventoryOperationRepository, scrapTestObjects.ScrapDomainService);

            var orderConfigurator = new OrderConfigurator(
                new OrderStateFactory(
                    inventoryOperationDomainService
                    ));

            this.OrderDomainService = new OrderDomainService(new OrderRepository(this.UnitOfWorkScope, orderConfigurator, new EFRepository<OrderItem>(this.UnitOfWorkScope)));

            var client = new WebClientHelper(new HttpClient());
            var hostAdapter = new ExternalHostAddressHelper();

            var goodDomainService = new GoodDomainService(
                           new GoodAntiCorruptionAdapter(
                               new GoodAntiCorruptionServiceWrapper(client, hostAdapter),
                               new GoodAntiCorruptionMapper()),
                           new EFRepository<Good>(this.UnitOfWorkScope),
                           basicInfoDomainServiceObjects.CompanyDomainService, new EFRepository<GoodUnit>(this.UnitOfWorkScope));
            var inventoryManagementDomainService = new InventoryManagementDomainService(goodDomainService, currencyDomainService);

            this.FuelReportDomainService = new FuelReportDomainService(
                this.FuelReportRepository,
                this.VoyageDomainService,
                inventoryOperationDomainService,
                inventoryOperationRepository,
                inventoryOperationFactory,
                OrderDomainService,
                inventoryManagementDomainService
                ,
                new CharteringDomainService(new CharterInRepository(this.UnitOfWorkScope), new CharterOutRepository(this.UnitOfWorkScope)));

            this.WorkflowLogRepository = new WorkflowLogRepository(this.UnitOfWorkScope);

            //var inventoryOperationNotifier = new InventoryOperationNotifier();

            this.FuelReportApplicationService = null;
            //this.FuelReportApplicationService = new FuelReportApplicationService(
            //    this.UnitOfWorkScope,
            //    currencyDomainService,
            //    this.VoyageDomainService,
            //    FuelReportDomainService,
            //    new ApproveFlowApplicationService(this.UnitOfWorkScope, new WorkflowLogRepository(this.UnitOfWorkScope), new WorkflowRepository(this.UnitOfWorkScope), new OrderConfigurator(new OrderStateFactory(new InventoryOperationDomainService(new InventoryOperationRepository(this.UnitOfWorkScope), new ScrapDomainService(new ScrapRepository(this.UnitOfWorkScope, new ScrapConfigurator(new ScrapStateFactory(new ApprovableScrapDomainService(new VesselDomainService(new BaseAntiCorruptionAdapter<Vessel, WarehouseDto>(), ), )))), )), )), ));

            var goodMapper = new GoodToGoodDtoMapper(new CompanyGoodUnitToGoodUnitDtoMapper());
            var currencyMapper = new CurrencyToCurrencyDtoMapper();

            var companyDtoMapper = new BaseFacadeMapper<Company, CompanyDto>();
            var vesselDtoMapper = new VesselToVesselDtoMapper(companyDtoMapper);

            var fuelReportDetailMapper = new FuelReportDetailToFuelReportDetailDtoMapper(goodMapper, currencyMapper);

            var fuelReportToFuelReportDtoMapper = new FuelReportToFuelReportDtoMapper(
                fuelReportDetailMapper,
                vesselDtoMapper);

            this.VoyageFacadeService = new VoyageFacadeService(
                VoyageDomainService,
                new VoyageToVoyageDtoMapper(),
                FuelReportDomainService,
                fuelReportToFuelReportDtoMapper,
                inventoryOperationDomainService,
                new InventoryOperationToInventoryOperationDtoMapper(fuelReportDetailMapper),
                this.VoyageLogDomainService,
                new VoyageLogToVoyageLogDtoMapper(companyDtoMapper, vesselDtoMapper),
                goodMapper);
        }
Ejemplo n.º 2
0
 public void TestInitialize()
 {
     orderItemToDtoMapper = new OrderItemToDtoMapper(new GoodToGoodDtoMapper(new CompanyGoodUnitToGoodUnitDtoMapper()));
     goodUnitMapper = new CompanyGoodUnitToGoodUnitDtoMapper();
     goodToGoodDtoMapper = new GoodToGoodDtoMapper(goodUnitMapper);
 }