Esempio n. 1
0
        public void CreateHexConverterTest2(
            CsvTypeCode typeCode,
            bool nullable,
            bool throwOnParseErrors,
            Type converterType)
        {
            ICsvTypeConverter conv = CsvConverterFactory.CreateHexConverter(typeCode, nullable, true, throwOnParseErrors);

            Assert.AreEqual(converterType, conv.Type);
            Assert.IsTrue(Convert.IsDBNull(conv.FallbackValue));
            Assert.AreEqual(throwOnParseErrors, conv.ThrowsOnParseErrors);
        }
Esempio n. 2
0
        public void CreateHexConverterTest1(
            CsvTypeCode typeCode,
            bool nullable,
            bool throwOnParseErrors,
            Type converterType,
            object?fallBackValue)
        {
            ICsvTypeConverter conv = CsvConverterFactory.CreateHexConverter(typeCode, nullable, false, throwOnParseErrors);

            Assert.AreEqual(converterType, conv.Type);
            Assert.AreEqual(fallBackValue, conv.FallbackValue);
            Assert.AreEqual(throwOnParseErrors, conv.ThrowsOnParseErrors);
        }
Esempio n. 3
0
        public void RoundtripTest2()
        {
            int i = 123456789;

            ICsvTypeConverter conv = CsvConverterFactory.CreateHexConverter(CsvTypeCode.Int32);

            string?s = conv.ConvertToString(i)?.ToLowerInvariant();

            Assert.IsNotNull(s);

            var i2 = (int?)conv.Parse(s);

            Assert.AreEqual(i, i2);
        }
Esempio n. 4
0
        public void HexConverterTest1()
        {
            ICsvTypeConverter conv = CsvConverterFactory.CreateHexConverter(CsvTypeCode.Int32);

            Assert.IsInstanceOfType(conv, typeof(HexConverter <int>));
        }
Esempio n. 5
0
 public void HexConverterTest2() => _ = CsvConverterFactory.CreateHexConverter(CsvTypeCode.Double);