private SettingViewModelBuilder CreateDefaultSettingViewModelBuilderWithCustomModel(CustomJewelPersistenceForSetting customJewelForSetting) { var settingManager = new FakeSettingManager(); var jewelryRepository = new FakeJewelRepository(settingManager); var diamondRepository = new FakeDiamondRepository(mapper); var webHelpers = MockRepository.GenerateStub <IWebHelpers>(); var tabsForJewelDesignBuilder = new TabsForJewelDesignNavigationBuilder(customJewelForSetting, diamondRepository, jewelryRepository, webHelpers); var fakeRepository = new FakeJewelRepository(settingManager); var fileSystem = FakeFileSystem.MediaFileSystemForItemNumber("0101-15421"); var fakeTestimonialRepository = new FakeTestimonialRepository(mapper); var jewelryItemViewModelBuilder = new JewelryItemViewModelBuilder(Tests.FAKE_JEWELRY_REPOSITORY_FIRST_ITEM_ID, fakeRepository, fakeTestimonialRepository, fileSystem, mapper); var builder = new SettingViewModelBuilder(customJewelForSetting, tabsForJewelDesignBuilder, jewelryItemViewModelBuilder); return(builder); }
//TODO add two tests for width and weight NA testing #region Helpers private JewelryItemViewModelBuilder JewelryItemViewModelBuilderFactoryMethod() { var settingManager = new FakeSettingManager(); var fakeRepository = new FakeJewelRepository(settingManager); var fakeTestimonailRepository = new FakeTestimonialRepository(mapper); var fileSystem = FakeFileSystem.MediaFileSystemForItemNumber("0101-15421"); var builder = new JewelryItemViewModelBuilder(Tests.FAKE_JEWELRY_REPOSITORY_FIRST_ITEM_ID, fakeRepository, fakeTestimonailRepository, fileSystem, mapper); return(builder); }
private JewelryItemViewModelBuilder JewelryItemViewModelBuilderFactoryMethodWithJewelID(int jewelD) { var settingManager = new FakeSettingManager(); var fakeRepository = new FakeJewelRepository(settingManager); var fileSystem = FakeFileSystem.MediaFileSystemForItemNumber("0101-15421"); var fakeTestimonailRepository = new FakeTestimonialRepository(mapper); var builder = new JewelryItemViewModelBuilder(jewelD, fakeRepository, fakeTestimonailRepository, fileSystem, mapper); return(builder); }
private JewelryItemViewModelBuilder CreateJewelItemViewModelBuilderWithJewel(Jewel jewel) { var fakeRepository = MockRepository.GenerateStub <IJewelRepository>(); fakeRepository.Stub(x => x.GetJewelByID(Arg <int> .Is.Anything)).Return(jewel); var fakeTestimonailRepository = new FakeTestimonialRepository(mapper); var fileSystem = FakeFileSystem.MediaFileSystemForItemNumber(jewel.ItemNumber); var builder = new JewelryItemViewModelBuilder(Tests.FAKE_JEWELRY_REPOSITORY_FIRST_ITEM_ID, fakeRepository, fakeTestimonailRepository, fileSystem, mapper); return(builder); }
public ActionResult Index(int id, JewelMediaType?nullableMediaSet) { var mediaSet = nullableMediaSet ?? JewelMediaType.WhiteGold; jewelRepository.FilterMediaByMetal(mediaSet); var builder = new JewelryItemViewModelBuilder(id, jewelRepository, testimonailRepository, fileSystem, mapper); try { var viewModel = builder.Build(); viewModel.PathBarItems = pathBarGenerator.GenerateUsing <UsingDynamicTitlePathBarResolver, dynamic>(viewModel); return(View(viewModel)); } catch (ArgumentNullException) { throw new ArgumentNullException("Bad Request for an item"); } }
public ActionResult Setting(CustomJewelPersistenceForSetting customJewelPersistenceForSetting) { var tabsForJewelNavigation = new TabsForJewelDesignNavigationBuilder(customJewelPersistenceForSetting, diamondRepository, jewelRepository, webHelpers); tabsForJewelNavigation.WhichTabToHighLight(NagivationTabType.ChooseSetting); jewelRepository.FilterMediaByMetal(customJewelPersistenceForSetting.MediaType == 0 ? JewelMediaType.WhiteGold : customJewelPersistenceForSetting.MediaType); var jewelryItemViewModelBuilder = new JewelryItemViewModelBuilder(customJewelPersistenceForSetting.SettingID, jewelRepository, testimonialRepository, fileSystem, mapper); var builder = new SettingViewModelBuilder(customJewelPersistenceForSetting, tabsForJewelNavigation, jewelryItemViewModelBuilder); var viewModel = builder.Build(); viewModel.PathBarItems = pathBarGenerator.GenerateUsing <UsingDynamicTitlePathBarResolver, dynamic>(viewModel); return(View(viewModel)); }
private JewelryItemViewModelBuilder JewelryItemViewModelBuilderFactoryMethodWithJewelID(int jewelD) { var settingManager = new FakeSettingManager(); var fakeRepository = new FakeJewelRepository(settingManager); var fileSystem = FakeFileSystem.MediaFileSystemForItemNumber("0101-15421"); var fakeTestimonailRepository = new FakeTestimonialRepository(mapper); var builder = new JewelryItemViewModelBuilder(jewelD, fakeRepository, fakeTestimonailRepository,fileSystem,mapper); return builder; }
private JewelryItemViewModelBuilder JewelryItemViewModelBuilderFactoryMethod( Dictionary<string, MockFileData> files ) { var settingManager = new FakeSettingManager(); var fakeRepository = new FakeJewelRepository(settingManager); var fileSystem = FakeFileSystem.MediaFileSystemForItemNumber(files); var fakeTestimonailRepository = new FakeTestimonialRepository(mapper); var builder = new JewelryItemViewModelBuilder(Tests.FAKE_JEWELRY_REPOSITORY_FIRST_ITEM_ID, fakeRepository,fakeTestimonailRepository, fileSystem,mapper); return builder; }
private JewelryItemViewModelBuilder CreateJewelItemViewModelBuilderWithJewel(Jewel jewel) { var fakeRepository = MockRepository.GenerateStub<IJewelRepository>(); fakeRepository.Stub(x => x.GetJewelByID(Arg<int>.Is.Anything)).Return(jewel); var fakeTestimonailRepository = new FakeTestimonialRepository(mapper); var fileSystem = FakeFileSystem.MediaFileSystemForItemNumber(jewel.ItemNumber); var builder = new JewelryItemViewModelBuilder(Tests.FAKE_JEWELRY_REPOSITORY_FIRST_ITEM_ID, fakeRepository, fakeTestimonailRepository, fileSystem, mapper); return builder; }
public ActionResult Index(int id, JewelMediaType? nullableMediaSet) { var mediaSet = nullableMediaSet ?? JewelMediaType.WhiteGold; jewelRepository.FilterMediaByMetal(mediaSet); var builder = new JewelryItemViewModelBuilder(id, jewelRepository, testimonailRepository,fileSystem,mapper); try { var viewModel = builder.Build(); viewModel.PathBarItems = pathBarGenerator.GenerateUsing<UsingDynamicTitlePathBarResolver, dynamic>(viewModel); return View(viewModel); } catch (ArgumentNullException) { throw new ArgumentNullException("Bad Request for an item"); } }
public ActionResult Setting(CustomJewelPersistenceForSetting customJewelPersistenceForSetting) { var tabsForJewelNavigation = new TabsForJewelDesignNavigationBuilder(customJewelPersistenceForSetting, diamondRepository, jewelRepository, webHelpers); tabsForJewelNavigation.WhichTabToHighLight(NagivationTabType.ChooseSetting); jewelRepository.FilterMediaByMetal(customJewelPersistenceForSetting.MediaType == 0 ? JewelMediaType.WhiteGold : customJewelPersistenceForSetting.MediaType); var jewelryItemViewModelBuilder = new JewelryItemViewModelBuilder(customJewelPersistenceForSetting.SettingID, jewelRepository,testimonialRepository ,fileSystem,mapper); var builder = new SettingViewModelBuilder(customJewelPersistenceForSetting, tabsForJewelNavigation, jewelryItemViewModelBuilder); var viewModel = builder.Build(); viewModel.PathBarItems = pathBarGenerator.GenerateUsing<UsingDynamicTitlePathBarResolver, dynamic>(viewModel); return View(viewModel); }
public SettingViewModelBuilder(CustomJewelPersistenceForSetting customJewelForSetting, TabsForJewelDesignNavigationBuilder tabsForJewelDesignBuilder, JewelryItemViewModelBuilder jewelryItemViewModelBuilder) { this.customJewelForSetting = customJewelForSetting; this.tabsForJewelDesignBuilder = tabsForJewelDesignBuilder; this.jewelryItemViewModelBuilder = jewelryItemViewModelBuilder; }
private SettingViewModelBuilder CreateDefaultSettingViewModelBuilderWithCustomModel(CustomJewelPersistenceForSetting customJewelForSetting) { var settingManager = new FakeSettingManager(); var jewelryRepository = new FakeJewelRepository(settingManager); var diamondRepository = new FakeDiamondRepository(mapper); var webHelpers = MockRepository.GenerateStub<IWebHelpers>(); var tabsForJewelDesignBuilder = new TabsForJewelDesignNavigationBuilder(customJewelForSetting, diamondRepository, jewelryRepository, webHelpers); var fakeRepository = new FakeJewelRepository(settingManager); var fileSystem = FakeFileSystem.MediaFileSystemForItemNumber("0101-15421"); var fakeTestimonialRepository = new FakeTestimonialRepository(mapper); var jewelryItemViewModelBuilder = new JewelryItemViewModelBuilder(Tests.FAKE_JEWELRY_REPOSITORY_FIRST_ITEM_ID, fakeRepository, fakeTestimonialRepository, fileSystem, mapper); var builder = new SettingViewModelBuilder(customJewelForSetting, tabsForJewelDesignBuilder, jewelryItemViewModelBuilder); return builder; }