コード例 #1
0
        public void DownloadBooksImageFromDatabase()
        {
            IConfiguration        config  = new ConfigurationBuilder().AddJsonFile("appsettings.json", true, true).Build();
            ImageSelectionService service = new ImageSelectionService(config);
            List <ProductDetails> x       = new List <ProductDetails>();

            x.Add(new ProductDetails()
            {
                ProductType = ProductType.Book, UPC = "11111"
            });
            List <ProductImage> productImages = (List <ProductImage>)service.GetProductImages(x);

            Assert.IsTrue(productImages[0].ImageFound);
        }
コード例 #2
0
        public void DownloadGiftsImageFromDynamicURL()
        {
            IConfiguration        config  = new ConfigurationBuilder().AddJsonFile("appsettings.json", true, true).Build();
            ImageSelectionService service = new ImageSelectionService(config);
            List <ProductDetails> x       = new List <ProductDetails>();

            x.Add(new ProductDetails()
            {
                ProductType = ProductType.GiftMerchandise, UPC = "031009433957"
            });
            List <ProductImage> productImages = (List <ProductImage>)service.GetProductImages(x);

            Assert.IsTrue(productImages[0].ImageFound);
            Assert.IsTrue(productImages.Count >= 2);
        }
コード例 #3
0
        public void DownloadBooksImageFromDynamicURL()
        {
            //var imageServiceBuilder = new ContainerBuilder();
            //imageServiceBuilder.RegisterType<ConfigurationBuilder>().As<IConfigurationBuilder>();


            IConfiguration        config  = new ConfigurationBuilder().AddJsonFile("appsettings.json", true, true).Build();
            ImageSelectionService service = new ImageSelectionService(config);
            List <ProductDetails> x       = new List <ProductDetails>();

            x.Add(new ProductDetails()
            {
                ProductType = ProductType.Book, UPC = "9781476751474"
            });
            List <ProductImage> productImages = (List <ProductImage>)service.GetProductImages(x);

            Assert.IsTrue(productImages[0].ImageFound);
        }