Пример #1
0
        public void GetInteger32And64()
        {
            var column = new Column
            {
                DataType         = DataType.Integer,
                GroupSeparator   = ",",
                DecimalSeparator = "."
            };

            using (var test = new CsvFileReader(m_ValidSetting))
            {
                var inputValue = "17";

                var value32 = test.GetInt32Null(inputValue, column);
                Assert.AreEqual(17, value32.Value);

                var value64 = test.GetInt64Null(inputValue, column);
                Assert.AreEqual(17, value64.Value);

                value32 = test.GetInt32Null(null, column);
                Assert.IsFalse(value32.HasValue);

                value64 = test.GetInt64Null(null, column);
                Assert.IsFalse(value64.HasValue);
            }
        }