Ejemplo n.º 1
0
        public Jewel(ItemInitializerParameterObject itemInitializerParameterObject, Media media, Metal metal, JewelryExtra extra,JewelMediaType jewelMediaSets)
        {
            Media = media;
            ID = itemInitializerParameterObject.ID;

            JewelCategory = itemInitializerParameterObject.JewelryCategory;
            JewelSubCategory = itemInitializerParameterObject.JewelrySubCategory;
            JewelCategoryID = itemInitializerParameterObject.JewelryCategoryID;
            JewelSubCategoryID = itemInitializerParameterObject.JewelrySubCategoryID;

            ItemNumber = itemInitializerParameterObject.ItemNumber;

            Metal = metal;

            Price = itemInitializerParameterObject.Price;
            SpecialPrice = itemInitializerParameterObject.SpecialPrice;
            DealerPrice = itemInitializerParameterObject.DealerPrice;
            RegularPrice = itemInitializerParameterObject.RegularPrice;
            Title = itemInitializerParameterObject.Title;
            Weight = itemInitializerParameterObject.Weight;

            Width = itemInitializerParameterObject.Width;

            IsBestOffer = itemInitializerParameterObject.OnBargain;
            IsSpecial = itemInitializerParameterObject.OnSpecial;

            JewelryExtra = extra;

            MediaSetsOwnedByJewel = jewelMediaSets;
        }
Ejemplo n.º 2
0
        public Media BuildMedia()
        {
            var media = new Media();
            //paths from the setting manager end with "/"

            media.IconURLForWebDisplay = FillParametersIntoPathPattern(GetBaseWebPath(), itemNumber, "icon", conventionMetalPrefix, ImageExtension);
            media.PictureURLForWebDisplay = FillParametersIntoPathPattern(GetBaseWebPath(), itemNumber, "pic", conventionMetalPrefix, ImageExtension);
            media.HiResURLForWebDisplay = FillParametersIntoPathPattern(GetBaseWebPath(), itemNumber, "hires", conventionMetalPrefix, ImageExtension);
            media.HandURLForWebDisplay = FillParametersIntoPathPattern(GetBaseWebPath(), itemNumber, "hand", conventionMetalPrefix, ImageExtension);
            media.MovieURLForWebDisplay = FillParametersIntoPathPattern(GetBaseWebPath(), itemNumber, "mov", conventionMetalPrefix, MovieExtension);
            media.HiRes2URLForWebDisplay = FillParametersIntoPathPattern(GetBaseWebPath(), itemNumber, "hires2", conventionMetalPrefix, ImageExtension);

            media.IconDiskPathForWebDisplay = FillParametersIntoPathPattern(GetBaseDiskPath(), itemNumber, "icon", conventionMetalPrefix, ImageExtension);
            media.PictureDiskPathForWebDisplay = FillParametersIntoPathPattern(GetBaseDiskPath(), itemNumber, "pic", conventionMetalPrefix, ImageExtension);
            media.HiResDiskPathForWebDisplay = FillParametersIntoPathPattern(GetBaseDiskPath(), itemNumber, "hires", conventionMetalPrefix, ImageExtension);
            media.HandDiskPathForWebDisplay = FillParametersIntoPathPattern(GetBaseDiskPath(), itemNumber, "hand", conventionMetalPrefix, ImageExtension);
            media.MovieDiskPathForWebDisplay = FillParametersIntoPathPattern(GetBaseDiskPath(), itemNumber, "mov", conventionMetalPrefix, MovieExtension);

            media.HiRes2DiskPathForWebDisplay = FillParametersIntoPathPattern(GetBaseDiskPath(), itemNumber, "hires2", conventionMetalPrefix, ImageExtension);

            media.ReportURLForWebDisplay = FillParametersIntoPathPattern(GetBaseWebPath(), itemNumber, "report", conventionAllMetals, ImageExtension);
            media.ReportDiskPathForWebDisplay = FillParametersIntoPathPattern(GetBaseDiskPath(), itemNumber, "report", conventionAllMetals, ImageExtension);

            media.MediaSet = currentMediaSet;
            return media;
        }
Ejemplo n.º 3
0
        public Media Verify(Media media)
        {
            if (!fileSystem.File.Exists(media.IconDiskPathForWebDisplay))
            {
                return null;
            }

            if (!fileSystem.File.Exists(media.PictureDiskPathForWebDisplay))
            {
                return null;
            }

            if (!fileSystem.File.Exists(media.HiResDiskPathForWebDisplay))
            {
                media.HiResURLForWebDisplay = null;
            }

            if (!fileSystem.File.Exists(media.HandDiskPathForWebDisplay))
            {
                media.HandURLForWebDisplay = null;
            }

            if (!fileSystem.File.Exists(media.MovieDiskPathForWebDisplay))
            {
                media.MovieURLForWebDisplay = null;
            }

            if (!fileSystem.File.Exists(media.ReportDiskPathForWebDisplay))
            {
                media.ReportURLForWebDisplay = null;
            }

            if (!fileSystem.File.Exists(media.HiRes2DiskPathForWebDisplay))
            {
                media.HiRes2URLForWebDisplay = null;
            }

            return media;
        }
Ejemplo n.º 4
0
        public JsonMedia(Media media)
        {
            HandDiskPathForWebDisplay = media.HandDiskPathForWebDisplay;
            HandURLForWebDisplay = media.HandURLForWebDisplay;
            HiResDiskPathForWebDisplay = media.HiResDiskPathForWebDisplay;
            HiResURLForWebDisplay = media.HiResURLForWebDisplay;
            HiRes2DiskPathForWebDisplay = media.HiRes2DiskPathForWebDisplay;
            HiRes2URLForWebDisplay = media.HiRes2URLForWebDisplay;
            IconDiskPathForWebDisplay = media.IconDiskPathForWebDisplay;
            IconURLForWebDisplay = media.IconURLForWebDisplay;
            MediaSet = media.MediaSet;
            MovieDiskPathForWebDisplay = media.MovieDiskPathForWebDisplay;
            MovieURLForWebDisplay = media.MovieURLForWebDisplay;
            PictureDiskPathForWebDisplay = media.PictureDiskPathForWebDisplay;
            PictureURLForWebDisplay = media.PictureURLForWebDisplay;

            ReportURLForWebDisplay = media.ReportURLForWebDisplay;
            ReportDiskPathForWebDisplay = media.ReportDiskPathForWebDisplay;

            MediaSetFullName = Metal.GetFullName(MediaSet);

            MediaSetName = media.MediaSet.ToString();
        }
Ejemplo n.º 5
0
        public void MetalSetFullName_ShouldReturnMediaSetFullNameYellowGold()
        {
            //Arrange
            var media1 = new Media()
            {
                IconDiskPathForWebDisplay = @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-icon-wg.jpg",
                PictureDiskPathForWebDisplay = @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-pic-wg.jpg",
                HiResDiskPathForWebDisplay = @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-hires-wg.jpg",
                HandDiskPathForWebDisplay = @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-hand-wg.jpg",
                MovieDiskPathForWebDisplay = @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-mov-wg.flv",

                IconURLForWebDisplay = @"/jon-images/jewel/0101-15001-icon-wg.jpg",
                PictureURLForWebDisplay = @"/jon-images/jewel/0101-15001-pic-wg.jpg",
                HiResURLForWebDisplay = @"/jon-images/jewel/0101-15001-hires-wg.jpg",
                HandURLForWebDisplay = @"/jon-images/jewel/0101-15001-hand-wg.jpg",
                MovieURLForWebDisplay = @"/jon-images/jewel/0101-15001-mov-wg.flv",
                MediaSet = JewelMediaType.YellowGold

            };
            //Act
            var jsonMedia = new JsonMedia(media1);
            //Assert
            jsonMedia.MediaSetFullName.Should().Be("Yellow Gold 18 Karat");
        }
        private IMediaSetBuilder GetMediaSetBuilder()
        {
            //the parameters are not important for the test but must be included for the extract and override pattern

            var media1 = new Media()
            {
                IconDiskPathForWebDisplay = @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-icon-wg.jpg",
                PictureDiskPathForWebDisplay = @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-pic-wg.jpg",
                HiResDiskPathForWebDisplay = @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-hires-wg.jpg",
                HandDiskPathForWebDisplay = @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-hand-wg.jpg",
                MovieDiskPathForWebDisplay = @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-mov-wg.flv",

                IconURLForWebDisplay = @"/jon-images/jewel/0101-15001-icon-wg.jpg",
                PictureURLForWebDisplay = @"/jon-images/jewel/0101-15001-pic-wg.jpg",
                HiResURLForWebDisplay = @"/jon-images/jewel/0101-15001-hires-wg.jpg",
                HandURLForWebDisplay = @"/jon-images/jewel/0101-15001-hand-wg.jpg",
                MovieURLForWebDisplay = @"/jon-images/jewel/0101-15001-mov-wg.flv",
                MediaSet = JewelMediaType.WhiteGold

            };

            var media2 = new Media()
            {
                IconDiskPathForWebDisplay = @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-icon-yg.jpg",
                PictureDiskPathForWebDisplay = @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-pic-yg.jpg",
                HiResDiskPathForWebDisplay = @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-hires-yg.jpg",
                HandDiskPathForWebDisplay = @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-hand-yg.jpg",
                MovieDiskPathForWebDisplay = @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-mov-yg.flv",

                IconURLForWebDisplay = @"/jon-images/jewel/0101-15001-icon-yg.jpg",
                PictureURLForWebDisplay = @"/jon-images/jewel/0101-15001-pic-yg.jpg",
                HiResURLForWebDisplay = @"/jon-images/jewel/0101-15001-hires-yg.jpg",
                HandURLForWebDisplay = @"/jon-images/jewel/0101-15001-hand-yg.jpg",
                MovieURLForWebDisplay = @"/jon-images/jewel/0101-15001-mov-yg.flv",
                MediaSet = JewelMediaType.YellowGold

            };

            var fakeMediaSetBuilder = MockRepository.GenerateStub<IMediaSetBuilder>();

            fakeMediaSetBuilder.Stub(x => x.Build(Arg<string>.Is.Anything,Arg<JewelMediaType>.Is.Anything)).Return(new List<JsonMedia>()
                                                                    {
                                                                        {new JsonMedia(media1)},
                                                                        {new JsonMedia(media2)}
                                                                    });

            return fakeMediaSetBuilder;
        }
Ejemplo n.º 7
0
 private Media CreateMedia()
 {
     var media = new Media()
                     {
                         IconDiskPathForWebDisplay =
                             @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-icon-wg.jpg",
                         PictureDiskPathForWebDisplay =
                             @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-pic-wg.jpg",
                         HiResDiskPathForWebDisplay =
                             @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-hires-wg.jpg",
                         HiRes2DiskPathForWebDisplay =
                             @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-hires2-wg.jpg",
                         HandDiskPathForWebDisplay =
                             @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-hand-wg.jpg",
                         MovieDiskPathForWebDisplay =
                             @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-mov-wg.flv",
                         ReportDiskPathForWebDisplay =
                             @"C:\Users\maMLUka\Documents\jewelryonnet\internet-sites\jon-images\jewelry\0101-15001-report-all.jpg",
                         IconURLForWebDisplay = @"/jon-images/jewel/0101-15001-icon-wg.jpg",
                         PictureURLForWebDisplay = @"/jon-images/jewel/0101-15001-pic-wg.jpg",
                         HiResURLForWebDisplay = @"/jon-images/jewel/0101-15001-hires-wg.jpg",
                         HiRes2URLForWebDisplay = @"/jon-images/jewel/0101-15001-hires2-wg.jpg",
                         HandURLForWebDisplay = @"/jon-images/jewel/0101-15001-hand-wg.jpg",
                         MovieURLForWebDisplay = @"/jon-images/jewel/0101-15001-mov-wg.flv",
                         ReportURLForWebDisplay = @"/jon-images/jewel/0101-15001-report-all.jpg"
                     };
     return media;
 }