예제 #1
0
        public void DeserializeEmptyNumberField()
        {
            var serializer = new IntegerFieldSerializer <NumberField>();

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

            Assert.False(field.Value.HasValue);
        }
예제 #2
0
        public void DeserializeNumberField()
        {
            var serializer = new IntegerFieldSerializer <NumberField>();
            var number     = new NumberField
            {
                Value = 25
            };
            var str = "25";

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

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