Beispiel #1
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);
        }