コード例 #1
0
        public void EmptyStringNumberTest_InvalidCast()
        {
            var cell = new GoogleDataCell()
            {
                Value = string.Empty,
                Formatted = string.Empty,
                DataType = ColumnDataType.Number
            };

            cell.ToJson();
        }
コード例 #2
0
        public void Date_Cell_Test()
        {
            var cell = new GoogleDataCell()
            {
                Value = new DateTime(2011, 10, 24),
                Formatted = string.Empty,
                DataType = ColumnDataType.Date
            };

            Assert.AreEqual("{\"v\":new Date(2011,9,24),\"f\":\"\"}", cell.ToJson());
        }
コード例 #3
0
        public void Char_Cell_Test()
        {
            var cell = new GoogleDataCell()
            {
                Value = 'a',
                Formatted = string.Empty,
                DataType = ColumnDataType.String
            };

            Assert.AreEqual("{\"v\":\"a\",\"f\":\"\"}", cell.ToJson());
        }
コード例 #4
0
        public void Bool_Cell_Test()
        {
            var cell = new GoogleDataCell()
            {
                Value = true,
                Formatted = string.Empty,
                DataType = ColumnDataType.Boolean
            };

            Assert.AreEqual("{\"v\":\"true\",\"f\":\"\"}", cell.ToJson());

            cell.Value = false;

            Assert.AreEqual("{\"v\":\"false\",\"f\":\"\"}", cell.ToJson());
        }
コード例 #5
0
        public void Null_Cell_Value_Test()
        {
            var cell = new GoogleDataCell()
            {
                Value = null,
                Formatted = string.Empty,
                DataType = ColumnDataType.Number
            };

            Assert.AreEqual("{\"v\":null,\"f\":\"\"}", cell.ToJson());
        }