private void AssertValues(Type expectedType, params string[] values) { List <string> list = new List <string>(values); Type type = _Parser.GetType(list); Type EXPECTED_TYPE = typeof(decimal); Assert.AreEqual(expectedType, type); }
private Type GetColumnDataType(ExcelRangeBase sampleCells, DataTypeParser parser) { IEnumerable <ExcelRangeBase> sampleCellsEnumerable = (IEnumerable <ExcelRangeBase>)sampleCells; IList <ExcelRangeBase> sampleCellsList = sampleCellsEnumerable.ToList <ExcelRangeBase>(); IList <string> sampleValues = sampleCellsList. Select(c => c.Text). Where(t => !String.IsNullOrEmpty(t)). Distinct(). //Take(SAMPLE_COLUMN_COUNT). ToList(); Type result = parser.GetType(sampleValues); return(result); }