Пример #1
0
        public void ReadProductFileValidationTest()
        {
            //-- Arrange

            DataImporterService dataImporterService = new DataImporterService();
            ProductService      productService      = new ProductService();

            Companies = dataImporterService.GetCompanies();
            Feeds     = dataImporterService.GetFeeds();
            Products  = new List <Product>();
            //return Ok();
            foreach (Company company in Companies)
            {
                foreach (Feed feed in Feeds)
                {
                    if (company.Id.ToString().Substring(0, 1) == feed.Id.ToString().Substring(0, 1))
                    {
                        //Get Product for Company Feed
                        foreach (Product product in productService.GetProducts(company, feed))
                        {
                            Products.Add(product);
                        }
                    }
                }
            }

            //-- Act
            int actual = 18000;

            //-- Assert
            Assert.AreEqual(Products.Count, actual);
        }
Пример #2
0
        public void ReadFeedFileValidationTest()
        {
            //-- Arrange

            DataImporterService dataImporterService = new DataImporterService();
            ProductService      productService      = new ProductService();

            Feeds = dataImporterService.GetFeeds();
            int dataCount = 0;

            foreach (Feed feed in Feeds)
            {
                dataCount++;
            }

            //-- Act
            int actual = 15;

            //-- Assert
            Assert.AreEqual(dataCount, actual);
        }