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); }
//[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); } }