public void Build_ShouldReturnAJavaScriptJsonInitializerWithReportForTheSearchInitBecauseItWasSpecifiedInTheRouteDic()
        {
            var customJewel = new CustomJewelPersistenceForDiamondSearch();
            var diamondRepository = new FakeDiamondRepository(mapper);
            var webHelpers = MockRepository.GenerateStub<IWebHelpers>();
            var jewelRepository = new FakeJewelRepository(new FakeSettingManager());

            webHelpers.Stub(x => x.RouteUrl(Arg<string>.Is.Anything, Arg<RouteValueDictionary>.Is.Anything)).Return(
                Tests.STRING_THAT_HAS_NO_MEANING_IN_THIS_CONTEXT);

            customJewel.Report = Tests.STRING_THAT_IS_ASSERTED_BUT_HAS_NO_MEANING;

            var tabsForJewelDesignBuilder = new TabsForJewelDesignNavigationBuilder(customJewel, diamondRepository, jewelRepository, webHelpers);

            var builder = new DiamondSearchViewModelBuilder(customJewel, tabsForJewelDesignBuilder);
            //Act
            var viewModel = builder.Build();
            //Assert
            viewModel.JSONClientScriptInitializer["Report"].Should().Be(Tests.STRING_THAT_IS_ASSERTED_BUT_HAS_NO_MEANING);
        }
 public DiamondSearchViewModelBuilder(CustomJewelPersistenceForDiamondSearch customJewelPersistenceForDiamondSearch, TabsForJewelDesignNavigationBuilder tabsForJewelDesignNavigationBuilder)
 {
     this.customJewelPersistenceForDiamondSearch = customJewelPersistenceForDiamondSearch;
     this.tabsForJewelDesignNavigationBuilder = tabsForJewelDesignNavigationBuilder;
 }
        public ActionResult DiamondSearch(CustomJewelPersistenceForDiamondSearch customJewelPersistenceBaseClass)
        {
            var tabsForJewelDesignBuilder = new TabsForJewelDesignNavigationBuilder(customJewelPersistenceBaseClass, diamondRepository,
                                                                          jewelRepository, webHelpers);

            tabsForJewelDesignBuilder.WhichTabToHighLight(NagivationTabType.YourDiamond);

            var builder = new DiamondSearchViewModelBuilder(customJewelPersistenceBaseClass, tabsForJewelDesignBuilder);

            var viewModel = builder.Build();

            return View(viewModel);
        }
        public void Build_ShouldReturnAJavaScriptJsonInitializerWithSettingIDBecauseItWasSpecifiedInTheRouteDic()
        {
            var customJewel = new CustomJewelPersistenceForDiamondSearch();
            var diamondRepository = new FakeDiamondRepository(mapper);
            var webHelpers = MockRepository.GenerateStub<IWebHelpers>();
            var jewelRepository = new FakeJewelRepository(new FakeSettingManager());

            webHelpers.Stub(x => x.RouteUrl(Arg<string>.Is.Anything, Arg<RouteValueDictionary>.Is.Anything)).Return(
                Tests.STRING_THAT_HAS_NO_MEANING_IN_THIS_CONTEXT);

            customJewel.DiamondID = FIRST_DIAMOND_IN_REP;
            customJewel.SettingID = SETTING_ID;

            var tabsForJewelDesignBuilder = new TabsForJewelDesignNavigationBuilder(customJewel, diamondRepository, jewelRepository, webHelpers);

            var builder = new DiamondSearchViewModelBuilder(customJewel, tabsForJewelDesignBuilder);
            //Act
            var viewModel = builder.Build();
            //Assert
            viewModel.JSONClientScriptInitializer["SettingID"].Should().Be(Tests.FAKE_JEWELRY_REPOSITORY_FIRST_ITEM_ID.ToString());
        }
        public void Build_ShouldSetTheTabNAvigationModelProperty()
        {
            //Arrange
            var customJewel = new CustomJewelPersistenceForDiamondSearch();
            var diamondRepository = new FakeDiamondRepository(mapper);
            var webHelpers = MockRepository.GenerateStub<IWebHelpers>();
            var jewelRepository = new FakeJewelRepository(new FakeSettingManager());

            webHelpers.Stub(x => x.RouteUrl(Arg<string>.Is.Anything, Arg<RouteValueDictionary>.Is.Anything)).Return(
                "not important for this test");

            var tabsForJewelDesignBuilder = new TabsForJewelDesignNavigationBuilder(customJewel, diamondRepository, jewelRepository, webHelpers);

            var builder = new DiamondSearchViewModelBuilder(customJewel, tabsForJewelDesignBuilder);
            //Act
            var viewModel = builder.Build();
            //Assert
            viewModel.TabsForJewelDesignNavigation.Should().HaveCount(3);
        }