public void GetJewelByID_ShouldReturnNullIfYellowGoldRequestedButBotPresent() { //Arrange settingManager.Stub(x => x.GetJewelryBaseWebPath()).Return("/jon-images/jewel/"); settingManager.Stub(x => x.GetJewelryBaseDiskPath()).Return(@"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\"); JewelRepository jewelRepository = new JewelRepository(settingManager); jewelRepository.FilterMediaByMetal(JewelMediaType.YellowGold); //Act var jewel = jewelRepository.GetJewelByID(59324); //Assert jewel.Should().BeNull(); }
public void FilterJewelryItemsBy_ShouldOnlyReturnTheRightMetalMediaWhiteGold() { //Arrange var dynamicSQL = DynamicSQLWhereObject(); settingManager.Stub(x => x.GetJewelryBaseWebPath()).Return("/jon-images/jewel/"); JewelRepository jewelRepository = new JewelRepository(settingManager); //Act jewelRepository.FilterMediaByMetal(JewelMediaType.WhiteGold); var jewelrylist = jewelRepository.GetJewelsByDynamicSQL(dynamicSQL); //Assert jewelrylist.Should().OnlyContain(x => x.Media.IconURLForWebDisplay.Contains("wg")).And.HaveCount(9); }
public void FilterJewelryItemsBy_ShouldOnlyReturnYellowGoldMetalString() { //Arrange var dynamicSQL = DynamicSQLWhereObject(); settingManager.Stub(x => x.GetJewelryBaseWebPath()).Return("/jon-images/jewel/"); JewelRepository jewelRepository = new JewelRepository(settingManager); //Act jewelRepository.FilterMediaByMetal(JewelMediaType.YellowGold); var jewelrylist = jewelRepository.GetJewelsByDynamicSQL(dynamicSQL); //Assert jewelrylist.Should().OnlyContain(x => x.MetalFullName() == "Yellow Gold 18 Karat").And.HaveCount(9); }
public void FilterJewelryItemsBy_ShouldOnlyReturnTheRightMetalMediaAllMetals() { //Arrange var dynamicSQL = DynamicSQLWhereObject(); settingManager.Stub(x => x.GetJewelryBaseWebPath()).Return("/jon-images/jewel/"); JewelRepository jewelRepository = new JewelRepository(settingManager); //Act jewelRepository.FilterMediaByMetal(JewelMediaType.All); var jewelrylist = jewelRepository.GetJewelsByDynamicSQL(dynamicSQL); //Assert jewelrylist.Should().HaveCount(10); }