Пример #1
0
        public void DeserializeEmptyDateField()
        {
            var serializer = new DateFieldSerializer();

            var field = (DateField)serializer.Deserialize(null);

            Assert.False(field.Value.HasValue);
        }
Пример #2
0
        public void DeserializeDateField()
        {
            var serializer = new DateFieldSerializer();
            var date       = new DateTime(2001, 1, 5, 16, 0, 0);
            var str        = "2001-01-05 16:00:00";

            var field = (DateField)serializer.Deserialize(str);

            Assert.NotNull(field);
            Assert.Equal(date, field.Value.Value);
        }