Inheritance: MongoRepositoryBase
コード例 #1
0
        public void DBLoader_Test()
        {
            //arrange
            string folder = @"C:\Temp\spontaneouse\catalogData";
            var  testdb = new MongoDBForTest().DB;
            testdb.Drop();
            DBLoader dbLoader = new DBLoader(testdb, folder);

            Assert.IsTrue(dbLoader.FilesForLoadingToDB.Length > 0);

            //act
            var statuses = dbLoader.DoLoad();

            Assert.AreEqual(statuses.Count, dbLoader.FilesForLoadingToDB.Length);
        }
コード例 #2
0
        //[TestMethod]
        public void AddExtendedDataTest()
        {
            //arrange
            var testdb = new MongoDBForTest().DB;
            MongoEntityRepositoryBase<ProductBasicData> basicData = new MongoEntityRepositoryBase<ProductBasicData>(testdb);
            List<ProductBasicData> products = basicData.GetAll().ToList();

            ProductFetcher extendDataFetcher = new ProductFetcher();
            ProductDataExtendedDataBuilder builder = new ProductDataExtendedDataBuilder();

            //act
            foreach (var product in products)
            {
                string crawledHtml = extendDataFetcher.GetProductExtendedData(product);
                product.ExtendedData = builder.Build(crawledHtml);
            }
        }