Пример #1
0
        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);
        }
Пример #2
0
        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);
        }