private void ImportBusinessFeature() { ImportAndValidate("BusinessFeature.xlsx", stream => { var importer = new BusinesFeatureImport(stream); importer.Import(); }); }
public void BusinessFeatureImport() { ImportAndValidate("BusinessFeature.xlsx", stream => { var importer = new BusinesFeatureImport(stream); importer.Import(); var data = Context.BusinessFeatures.First(); Assert.AreEqual(101, data.Id); Assert.AreEqual("室内停车场", data.Name); Assert.AreEqual(1, data.BusinessValueId); Assert.AreEqual(0.2, data.Hdyza); Assert.AreEqual(importer.RowCount, 60); Assert.AreEqual(Context.BusinessFeatures.Count(), 59); }); }
private static void ImportFromFolder() { var folder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ImportData"); ExcelDataImportBase importer = new CellMappingImport(Path.Combine(folder, "CellMapping.xlsx")); importer.Import(); importer = new ConstructionValueImport(Path.Combine(folder, "ConstructionValue.xlsx")); importer.Import(); importer = new BusinessValueImport(Path.Combine(folder, "BusinessValue.xlsx")); importer.Import(); importer = new BusinesFeatureImport(Path.Combine(folder, "BusinessFeature.xlsx")); importer.Import(); importer = new RiskLevelImport(Path.Combine(folder, "RiskLevel.xlsx")); importer.Import(); }