public void GetDataTypeNameTestAsync() { using (var test = new DataTableWrapper(m_DataTable)) { Assert.AreEqual(DataType.Integer.GetNetType().Name, test.GetDataTypeName(0)); Assert.AreEqual(nameof(String), test.GetDataTypeName(1)); Assert.AreEqual(nameof(DateTime), test.GetDataTypeName(4)); try { Assert.AreEqual(nameof(DateTime), test.GetDataTypeName(5)); Assert.Fail("Expected exception"); } catch (Exception) { //fine } } }
public void GetDataTypeNameTest() { using (var processDisplay = new CustomProcessDisplay(UnitTestInitializeCsv.Token)) { using (var test = new DataTableWrapper(m_DataTable)) { // await test.OpenAsync(processDisplay.CancellationToken); var typeName = test.GetDataTypeName(0); Assert.IsTrue(typeName.Equals("int") || typeName.Equals("Int32") || typeName.Equals("Int64") || typeName.Equals("long")); } } }