예제 #1
0
        public void GetValue_Nullable()
        {
            var cell = new XLWorkbook().AddWorksheet().FirstCell();

            Assert.IsNull(cell.Clear().GetValue <double?>());
            Assert.AreEqual(1.5, cell.SetValue(1.5).GetValue <double?>());
            Assert.AreEqual(2, cell.SetValue(1.5).GetValue <int?>());
            Assert.AreEqual(2.5, cell.SetValue("2.5").GetValue <double?>());
            Assert.Throws <FormatException>(() => cell.SetValue("text").GetValue <double?>());
        }