コード例 #1
0
        public void InitMVP()
        {
            view = new MockApprovals();
            ordersService = new MockOrdersService();
            ordersConverter = new OrdersConverter(new MockCustomerService(), new MockEmployeeService(), new MockGenericConverter<Employee,EmployeeDisplay>());
            httpContextLocatorService = new MockHttpContextLocatorService();
            presenter = new ApprovalsPresenter(ordersService, ordersConverter, httpContextLocatorService);

            presenter.View = view;
        }
コード例 #2
0
        public void InitMVP()
        {
            view = new MockSavedDrafts();
            ordersService = new MockOrdersService();
            ordersController = new MockOrdersController();
            ordersConverter = new OrderManagement.Orders.Converters.OrdersConverter(new MockCustomerService(), new MockEmployeeService(), new MockGenericConverter<Employee, EmployeeDisplay>());
            httpContextLocatorService = new MockHttpContextLocatorService();
            presenter = new SavedDraftsPresenter(ordersService, ordersController, ordersConverter, httpContextLocatorService);

            presenter.View = view;
        }
コード例 #3
0
        public void LoadCallsAddGlobalServices()
        {
            TestableRootCompositionContainer parentContainer = new TestableRootCompositionContainer();
            TestableRootCompositionContainer container = parentContainer.Containers.AddNew<TestableRootCompositionContainer>("TEST");

            TestableModuleInitializer moduleInitializer = new TestableModuleInitializer();
            ISiteMapBuilderService siteMapBuilder = new MockSiteMapBuilderService();
            IHttpContextLocatorService contextLocator = new MockHttpContextLocatorService();
            container.Services.Add<IHttpContextLocatorService>(contextLocator);
            container.Services.Add<ISiteMapBuilderService>(siteMapBuilder);

            moduleInitializer.Load(container);

            Assert.IsTrue(moduleInitializer.AddGlobalServicesWasCalled);
        }