예제 #1
0
        private static ISiteCatalogService MakeTestsService(bool useAutoFac, ref MockDependents mockDependents)
        {
            if (useAutoFac)
            {
                ContainerBuilder cb = GetTestsContainer();

                // Register mocks
                MockDependents.RegisterInContainer(ref cb);

                IContainer testcontainer = cb.Build();

                return(testcontainer.Resolve <ISiteCatalogService>());
            }
            mockDependents = new MockDependents();
            mockDependents.ICatalogLogic                  = MockDependents.MakeMockICatalogLogic();
            mockDependents.ICatalogRepository             = MockDependents.MakeMockICatalogRepository();
            mockDependents.IPriceLogic                    = MockDependents.MakeMockIPriceLogic();
            mockDependents.IHistoryListLogic              = MockDependents.MakeMockIHistoryListLogic();
            mockDependents.ICategoryImageRepository       = MockDependents.MakeMockICategoryImageRepository();
            mockDependents.IRecommendedItemsRepository    = MockDependents.MakeMockIRecommendedItemsRepository();
            mockDependents.IGrowthAndRecoveriesRepository = MockDependents.MakeMockIGrowthAndRecoveriesRepository();

            ISiteCatalogService testunit = new SiteCatalogServiceImpl(mockDependents.ICatalogLogic.Object, mockDependents.ICatalogRepository.Object,
                                                                      mockDependents.IPriceLogic.Object, mockDependents.IHistoryListLogic.Object,
                                                                      mockDependents.ICategoryImageRepository.Object,
                                                                      mockDependents.IRecommendedItemsRepository.Object,
                                                                      mockDependents.IGrowthAndRecoveriesRepository.Object);

            return(testunit);
        }
예제 #2
0
        private static IImportLogic MakeTestsLogic(bool useAutoFac, ref MockDependents mockDependents)
        {
            if (useAutoFac)
            {
                ContainerBuilder cb = GetTestsContainer();

                // Register mocks
                MockDependents.RegisterInContainer(ref cb);

                IContainer testcontainer = cb.Build();

                return(testcontainer.Resolve <IImportLogic>());
            }
            mockDependents = new MockDependents();
            mockDependents.CatalogLogic                   = MockDependents.MakeICatalogLogic();
            mockDependents.EventLogRepository             = MockDependents.MakeIEventLogRepository();
            mockDependents.ShoppingCartLogic              = MockDependents.MakeIShoppingCartLogic();
            mockDependents.PriceLogic                     = MockDependents.MakeIPriceLogic();
            mockDependents.CustomInventoryItemsRepository = MockDependents.MakeICustomInventoryItemsRepository();
            mockDependents.SiteCatalogService             = MockDependents.MakeISiteCatalogService();

            ImportLogicImpl testunit = new ImportLogicImpl(mockDependents.CatalogLogic.Object, mockDependents.EventLogRepository.Object, mockDependents.ShoppingCartLogic.Object,
                                                           mockDependents.PriceLogic.Object, mockDependents.CustomInventoryItemsRepository.Object, mockDependents.SiteCatalogService.Object);

            return(testunit);
        }
예제 #3
0
        private static IContractListChangesLogic MakeTestsLogic(bool useAutoFac, ref MockDependents mockDependents)
        {
            if (useAutoFac)
            {
                ContainerBuilder cb = GetTestsContainer();

                // Register mocks
                MockDependents.RegisterInContainer(ref cb);

                IContainer testcontainer = cb.Build();

                return(testcontainer.Resolve <IContractListChangesLogic>());
            }
            mockDependents = new MockDependents();
            mockDependents.CatalogLogic              = MockDependents.MakeMockCatalogLogic();
            mockDependents.CustomerRepository        = MockDependents.MakeMockCustomerRepository();
            mockDependents.EventLogRepository        = MockDependents.MakeMockEventLogRepository();
            mockDependents.GenericQueueRepository    = MockDependents.MakeMockGenericQueueRepository();
            mockDependents.ContractChangesRepository = MockDependents.MakeMockContractChangesRepository();
            mockDependents.MessageTemplateLogic      = MockDependents.MakeMockMessageTemplateLogic();

            ContractListChangesLogicImpl testunit = new ContractListChangesLogicImpl(mockDependents.CatalogLogic.Object, mockDependents.CustomerRepository.Object, mockDependents.EventLogRepository.Object,
                                                                                     mockDependents.GenericQueueRepository.Object, mockDependents.ContractChangesRepository.Object, mockDependents.MessageTemplateLogic.Object);

            return(testunit);
        }
예제 #4
0
        private static IOrderLogic MakeTestsLogic(bool useAutoFac, ref MockDependents mockDependents)
        {
            if (useAutoFac)
            {
                ContainerBuilder cb = GetTestsContainer();

                // Register mocks
                MockDependents.RegisterInContainer(ref cb);

                IContainer testcontainer = cb.Build();

                return(testcontainer.Resolve <IOrderLogic>());
            }
            mockDependents = new MockDependents();
            mockDependents.ICacheRepository             = MockDependents.MakeICacheRepository();
            mockDependents.ICatalogLogic                = MockDependents.MakeICatalogLogic();
            mockDependents.INoteLogic                   = MockDependents.MakeINoteLogic();
            mockDependents.ICustomerRepository          = MockDependents.MakeICustomerRepository();
            mockDependents.IEventLogRepository          = MockDependents.MakeIEventLogRepository();
            mockDependents.IOrderQueueLogic             = MockDependents.MakeIOrderQueueLogic();
            mockDependents.IOrderedFromListRepository   = MockDependents.MakeIOrderedFromListRepository();
            mockDependents.IKPayInvoiceRepository       = MockDependents.MakeIKPayInvoiceRepository();
            mockDependents.IPriceLogic                  = MockDependents.MakeIPriceLogic();
            mockDependents.IPurchaseOrderRepository     = MockDependents.MakeIPurchaseOrderRepository();
            mockDependents.IOrderHistoryHeaderRepsitory = MockDependents.MakeIOrderHistoryHeaderRepsitory();
            mockDependents.IShipDateRepository          = MockDependents.MakeIShipDateRepository();

            OrderLogicImpl testunit = new OrderLogicImpl(mockDependents.IPurchaseOrderRepository.Object, mockDependents.ICatalogLogic.Object, mockDependents.INoteLogic.Object,
                                                         mockDependents.ICacheRepository.Object, mockDependents.IOrderQueueLogic.Object, mockDependents.IPriceLogic.Object,
                                                         mockDependents.IEventLogRepository.Object, mockDependents.IShipDateRepository.Object, mockDependents.ICustomerRepository.Object,
                                                         mockDependents.IOrderHistoryHeaderRepsitory.Object, mockDependents.IKPayInvoiceRepository.Object,
                                                         mockDependents.IOrderedFromListRepository.Object, null, null);

            return(testunit);
        }
        private static IExportInvoicesService MakeTestsService(bool useAutoFac, ref MockDependents mockDependents)
        {
            if (useAutoFac)
            {
                ContainerBuilder cb = GetTestsContainer();

                // Register mocks
                MockDependents.RegisterInContainer(ref cb);

                var testcontainer = cb.Build();

                return(testcontainer.Resolve <IExportInvoicesService>());
            }
            else
            {
                mockDependents = new MockDependents();
                mockDependents.IExportSettingLogic    = MockDependents.MakeIExportSettingLogic();
                mockDependents.ICustomerRepository    = MockDependents.MakeICustomerRepository();
                mockDependents.IOrderLogic            = MockDependents.MakeIOrderLogic();
                mockDependents.IOnlinePaymentsLogic   = MockDependents.MakeIOnlinePaymentsLogic();
                mockDependents.IKPayInvoiceRepository = MockDependents.MakeIKPayInvoiceRepository();

                var testunit = new ExportInvoicesServiceImpl(mockDependents.IExportSettingLogic.Object, mockDependents.IOrderLogic.Object,
                                                             mockDependents.IOnlinePaymentsLogic.Object, mockDependents.IKPayInvoiceRepository.Object,
                                                             mockDependents.ICustomerRepository.Object);
                return(testunit);
            }
        }
        private static IOnlinePaymentsLogic MakeTestsLogic(bool useAutoFac, ref MockDependents mockDependents)
        {
            if (useAutoFac)
            {
                ContainerBuilder cb = GetTestsContainer();

                // Register mocks
                MockDependents.RegisterInContainer(ref cb);

                IContainer testcontainer = cb.Build();

                return(testcontainer.Resolve <IOnlinePaymentsLogic>());
            }
            mockDependents = new MockDependents();
            mockDependents.ICacheRepository                  = MockDependents.MakeICacheRepository();
            mockDependents.IAuditLogRepository               = MockDependents.MakeIAuditLogRepository();
            mockDependents.ICustomerBankRepository           = MockDependents.MakeICustomerBankRepository();
            mockDependents.ICustomerRepository               = MockDependents.MakeICustomerRepository();
            mockDependents.IEventLogRepository               = MockDependents.MakeIEventLogRepository();
            mockDependents.IGenericQueueRepository           = MockDependents.MakeIGenericQueueRepository();
            mockDependents.IInternalUserAccessRepository     = MockDependents.MakeIInternalUserAccessRepository();
            mockDependents.IKPayInvoiceRepository            = MockDependents.MakeIKPayInvoiceRepository();
            mockDependents.IKPayLogRepository                = MockDependents.MakeIKPayLogRepository();
            mockDependents.IKPayPaymentTransactionRepository = MockDependents.MakeIKPayPaymentTransactionRepository();
            mockDependents.IOrderHistoryHeaderRepsitory      = MockDependents.MakeIOrderHistoryHeaderRepsitory();

            OnlinePaymentLogicImpl testunit = new OnlinePaymentLogicImpl(mockDependents.IKPayInvoiceRepository.Object, mockDependents.ICustomerBankRepository.Object, mockDependents.IOrderHistoryHeaderRepsitory.Object,
                                                                         mockDependents.ICustomerRepository.Object, mockDependents.IGenericQueueRepository.Object, mockDependents.IKPayPaymentTransactionRepository.Object,
                                                                         mockDependents.IKPayLogRepository.Object, mockDependents.IAuditLogRepository.Object, mockDependents.IEventLogRepository.Object,
                                                                         mockDependents.IInternalUserAccessRepository.Object, mockDependents.ICacheRepository.Object);

            return(testunit);
        }
예제 #7
0
        private static IUserProfileRepository MakeTestsLogic(bool useAutoFac, ref MockDependents mockDependents)
        {
            if (useAutoFac)
            {
                ContainerBuilder cb = GetTestsContainer();

                // Register mocks
                MockDependents.RegisterInContainer(ref cb);

                IContainer testcontainer = cb.Build();

                return(testcontainer.Resolve <IUserProfileRepository>());
            }
            mockDependents = new MockDependents();
            mockDependents.IEventLogRepository = MockDependents.MakeIEventLogRepository();
            mockDependents.IAuditLogRepository = MockDependents.MakeIAuditLogRepository();

            UserProfileRepository testunit = new UserProfileRepository(mockDependents.IEventLogRepository.Object, mockDependents.IAuditLogRepository.Object);

            return(testunit);
        }
예제 #8
0
        private static ICacheListLogic MakeTestsLogic(bool useAutoFac, ref MockDependents mockDependents)
        {
            if (useAutoFac)
            {
                ContainerBuilder cb = GetTestsContainer();

                // Register mocks
                MockDependents.RegisterInContainer(ref cb);

                IContainer testcontainer = cb.Build();

                return(testcontainer.Resolve <ICacheListLogic>());
            }

            mockDependents = new MockDependents();
            mockDependents.CacheRepository = MockDependents.MakeICacheRepository();

            var testunit = new CacheListLogicImpl(mockDependents.CacheRepository.Object);

            return(testunit);
        }
예제 #9
0
        private static IDivisionLogic MakeTestsLogic(bool useAutoFac, ref MockDependents mockDependents)
        {
            if (useAutoFac)
            {
                ContainerBuilder cb = GetTestsContainer();

                // Register mocks
                MockDependents.RegisterInContainer(ref cb);

                var testcontainer = cb.Build();

                return(testcontainer.Resolve <IDivisionLogic>());
            }
            else
            {
                mockDependents = new MockDependents();
                mockDependents.DivisionRepository      = MockDependents.MakeDivisionRepositoryMock();
                mockDependents.BranchSupportRepository = MockDependents.MakeBranchSupportRepositoryMock();

                var testunit = new DivisionLogicImpl(mockDependents.DivisionRepository.Object, mockDependents.BranchSupportRepository.Object);
                return(testunit);
            }
        }
예제 #10
0
        private static IExportSettingLogic MakeTestsLogic(bool useAutoFac, ref MockDependents mockDependents)
        {
            if (useAutoFac)
            {
                ContainerBuilder cb = GetTestsContainer();

                // Register mocks
                MockDependents.RegisterInContainer(ref cb);

                IContainer testcontainer = cb.Build();

                return(testcontainer.Resolve <IExportSettingLogic>());
            }

            mockDependents = new MockDependents();
            mockDependents.ExportSettingRepository   = MockDependents.MakeIExportSettingRepository();
            mockDependents.ExternalCatalogRepository = MockDependents.MakeIExternalCatalogRepository();
            mockDependents.UnitOfWork = MockDependents.MakeIUnitOfWork();

            var testunit = new ExportSettingLogicImpl(mockDependents.UnitOfWork.Object,
                                                      mockDependents.ExportSettingRepository.Object, mockDependents.ExternalCatalogRepository.Object);

            return(testunit);
        }
예제 #11
0
        private static IReportLogic MakeTestsLogic(bool useAutoFac, ref MockDependents mockDependents)
        {
            if (useAutoFac)
            {
                ContainerBuilder cb = GetTestsContainer();

                // Register mocks
                MockDependents.RegisterInContainer(ref cb);

                IContainer testcontainer = cb.Build();

                return(testcontainer.Resolve <IReportLogic>());
            }
            mockDependents = new MockDependents();
            mockDependents.ICatalogLogic       = MockDependents.MakeICatalogLogic();
            mockDependents.ICatalogRepository  = MockDependents.MakeICatalogRepository();
            mockDependents.IReportRepository   = MockDependents.MakeIReportRepository();
            mockDependents.IEventLogRepository = MockDependents.MakeIEventLogRepository();

            ReportLogic testunit = new ReportLogic(mockDependents.ICatalogRepository.Object, mockDependents.IReportRepository.Object, mockDependents.IEventLogRepository.Object,
                                                   mockDependents.ICatalogLogic.Object);

            return(testunit);
        }