public void DiagnosticsCallback_Null_Test() { // Arrange var service = new Mock<DataTableServiceBase>(); // Act var harvester = new DataTableHarvester(service.Object); // Assert Assert.Null(harvester.DiagnosticsCallback); }
public void EndChar_Test() { // Arrange var service = new Mock<DataTableServiceBase>(); // Act var harvester = new DataTableHarvester(service.Object); // Assert Assert.Equal("###", harvester.EndChar); }
public void Harvest_Test() { // Arrange string fileName = Environment.CurrentDirectory + @"\Contracts.xlsx"; var sevice = new ExcelReaderService(fileName); var harvester = new DataTableHarvester(sevice); harvester.DiagnosticsCallback = Console.WriteLine; List<string> colums = new List<string>(); colums.Add("String"); colums.Add("Sbyte"); // Act IEnumerable<TestContract> items = harvester.Harvest<TestContract>(0, colums); // Assert Assert.True(items.Count() == 4); }
public void PerRowHarvest_Test() { // Arrange string fileName = Environment.CurrentDirectory + @"\Contracts.xlsx"; var sevice = new ExcelReaderService(fileName); var harvester = new DataTableHarvester(sevice); harvester.DiagnosticsCallback = Console.WriteLine; // Assert harvester.PerRowHarvest<TestContract>(0, Assert.NotNull); }