private ChooseSettingViewModelBuilder CreateDefaultChooseSettingViewModelBuilderWithChooseSettingModelAsAParameter(ChooseSettingViewModel chooseSettingViewModel)
        {
            var settingManager    = new FakeSettingManager();
            var tabsRepository    = TabsViewModelBuilderTests.CreateStubTabsRepository(JEWEL_DESIGN_TABKEY);
            var jewelryRepository = new FakeJewelRepository(settingManager);

            var fakeTabXmlFactory  = new FakeTabXmlFactory();
            var xmldoc_jeweldesign = fakeTabXmlFactory.JewelDesign3Tabs(JEWEL_DESIGN_TABKEY);


            var fileSystem = FakeFileSystem.MediaFileSystemForItemNumber("0101-15421");


            TabsViewModelBuilder tabsViewModelBuilder = new TabsViewModelBuilder(chooseSettingViewModel,
                                                                                 xmldoc_jeweldesign,
                                                                                 tabsRepository, jewelryRepository, fileSystem);

            var diamondRepository = new FakeDiamondRepository(mapper);
            var webHelpers        = MockRepository.GenerateStub <IWebHelpers>();

            var tabsForJewelDesignBuilder = new TabsForJewelDesignNavigationBuilder(chooseSettingViewModel,
                                                                                    diamondRepository, jewelryRepository,
                                                                                    webHelpers);


            var builder = new ChooseSettingViewModelBuilder(chooseSettingViewModel, tabsViewModelBuilder, tabsForJewelDesignBuilder);

            return(builder);
        }
Пример #2
0
        public ActionResult ChooseSetting(ChooseSettingViewModel chooseSettingViewModel)
        {
            var tabsource = xmlSourceFactory.TabSource();

            var tabsViewModelBuilder = new TabsViewModelBuilder(chooseSettingViewModel, tabsource, tabsRepository, jewelRepository, fileSystem);

            var tabsForJewelNavigation = new TabsForJewelDesignNavigationBuilder(chooseSettingViewModel, diamondRepository,
                                                                                 jewelRepository, webHelpers);

            tabsForJewelNavigation.WhichTabToHighLight(NagivationTabType.ChooseSetting);


            var builder = new ChooseSettingViewModelBuilder(chooseSettingViewModel, tabsViewModelBuilder, tabsForJewelNavigation);

            var viewModel = builder.Build();

            viewModel.PathBarItems = pathBarGenerator.GenerateUsing <TabsPathBarResolver, ITabsViewModel>(viewModel);

            return(View(viewModel));
        }