public ActionResult Import(ExportResult importData) { ExportImportService <T> tempService = new ExportImportService <T>(_context); tempService.SetImportResult(importData); return(Ok()); }
public void GetBasicsTest() { var exportResult = _exportService.SetImportResult(new ExportResult() { EntityName = "Table1", EntityData = new Table1() { Name = "AAA 2", Id = Guid.Parse("8ca5e277-77e7-4d70-9eb1-067156222da3"), SecondTableRows = new Table2[] { new Table2() { Name = "AAA 3", Id = "Cda", ThirdTableRows = new Table3[] { new Table3() { Name = "AAA 4", Id = 2 } } } } } }); // Check if result is true Assert.True(exportResult); DbSet <Table1> set = _context.Set <Table1>(); Table1 result = set.FirstOrDefault(); // Check if first Result is "AAA 2" Assert.True(result.Name == "AAA 2"); // Check if Table was cleared Assert.True(set.Count <Table1>() == 1); }