public TabsForJewelDesignNavigationBuilder(CustomJewelPersistenceBase customJewelPersistenceBase, IDiamondRepository diamondRepository, IJewelRepository jewelRepository, IWebHelpers webHelpers)
 {
     this.customJewelPersistenceBase = customJewelPersistenceBase;
     this.diamondRepository = diamondRepository;
     this.jewelRepository = jewelRepository;
     this.webHelpers = webHelpers;
     this.nagivationTabType = NagivationTabType.YourDiamond;
 }
Example #2
0
 public TabsForJewelDesignNavigationBuilder(CustomJewelPersistenceBase customJewelPersistenceBase, IDiamondRepository diamondRepository, IJewelRepository jewelRepository, IWebHelpers webHelpers)
 {
     this.customJewelPersistenceBase = customJewelPersistenceBase;
     this.diamondRepository          = diamondRepository;
     this.jewelRepository            = jewelRepository;
     this.webHelpers        = webHelpers;
     this.nagivationTabType = NagivationTabType.YourDiamond;
 }
        public void Build_DiamondTabShouldReturnModifyRouteAndCallTheRightRouteIfDiamondIsPresent()
        {
            //Arrange
            var customJewel = new CustomJewelPersistenceBase();
            var diamondRepository = new FakeDiamondRepository(mapper);
            var webHelpers = MockRepository.GenerateMock<IWebHelpers>();
            var jewelRepository = new FakeJewelRepository(new FakeSettingManager());

            customJewel.DiamondID = FIRST_DIAMOND_IN_REP;

            webHelpers.Expect(
                x =>
                x.RouteUrl(Arg<string>.Is.Equal("DiamondSearch"),
                           Arg<RouteValueDictionary>.Matches(d => (int)d["DiamondID"] == customJewel.DiamondID && (int)d["SettingID"] == customJewel.SettingID))).
                Return("/JewelDesign/DiamondSearch").Repeat.Any();

            var builder = new TabsForJewelDesignNavigationBuilder(customJewel, diamondRepository, jewelRepository, webHelpers);
            //Act
            var tabs = builder.Build();
            //Assert
            tabs[0].ModifyRoute.Should().Be("/JewelDesign/DiamondSearch");
            webHelpers.VerifyAllExpectations();
        }
        private TabsForJewelDesignNavigationBuilder CreateWithDiamondIDTabsForJewelDesignBuilder()
        {
            var customJewel = new CustomJewelPersistenceBase();
            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");

            customJewel.DiamondID = FIRST_DIAMOND_IN_REP;

            var builder = new TabsForJewelDesignNavigationBuilder(customJewel, diamondRepository, jewelRepository, webHelpers);
            return builder;
        }
 private TabsForJewelDesignNavigationBuilder CreateDefaultTabsForJewelDesignBuilderWithPersistenceAsAParameter(CustomJewelPersistenceBase customJewel)
 {
     var diamondRepository = new FakeDiamondRepository(mapper);
     var webHelpers = MockRepository.GenerateStub<IWebHelpers>();
     var jewelRepository = new FakeJewelRepository(new FakeSettingManager());
     var builder = new TabsForJewelDesignNavigationBuilder(customJewel, diamondRepository, jewelRepository, webHelpers);
     return builder;
 }