示例#1
0
        public void ConvertFromExcelTest()
        {
            var converter            = new GuidConverter();
            var typeConverterOptions = new TypeConverterOptions {
                CultureInfo = CultureInfo.CurrentCulture
            };

            var guid = new Guid("79f1a554-babd-41a1-8caf-185250a1fc21");

            Assert.AreEqual(guid, converter.ConvertFromExcel(typeConverterOptions, "79f1a554-babd-41a1-8caf-185250a1fc21"));
            Assert.AreEqual(guid, converter.ConvertFromExcel(typeConverterOptions, " 79f1a554-babd-41a1-8caf-185250a1fc21 "));

            try {
                converter.ConvertFromExcel(typeConverterOptions, null);
                Assert.Fail();
            } catch (ExcelTypeConverterException) {
            }
        }