Example #1
0
        public void ReadObject(int?value)
        {
            var number = value == null
                ? JsonValue.Null
                : JsonValue.Number(value.Value);

            _converter.ReadObject(number).Should().Be(value);
        }
Example #2
0
        public void ReadObject(int value)
        {
            var jsonValue = JsonValue.Number(value);

            _converter.ReadObject(jsonValue).Should().Be(value);
        }
Example #3
0
        public void ReadObject(double value)
        {
            var number = JsonValue.Number(value);

            _converter.ReadObject(number).Should().Be(value);
        }
Example #4
0
        public void ReadObject(TimeSpan value)
        {
            var number = JsonValue.TimeSpan(value);

            _converter.ReadObject(number).Should().Be(value);
        }
Example #5
0
        public void ReadObject(DateTime value)
        {
            var number = JsonValue.DateTime(value);

            _converter.ReadObject(number).Should().Be(value);
        }
Example #6
0
        public void ReadObject(Boo value)
        {
            var jsonObject = _converter.Write(value);

            _converter.ReadObject(jsonObject).Should().BeEquivalentTo(value);
        }
Example #7
0
        public void ReadObject(string value)
        {
            var str = JsonValue.String(value);

            _converter.ReadObject(str).Should().Be(value);
        }
Example #8
0
        public void ReadObject(DependencyLifetime value)
        {
            var jsonValue = JsonValue.Number((int)value);

            _converter.ReadObject(jsonValue).Should().Be(value);
        }
Example #9
0
        public void ReadObject(bool value)
        {
            var jsonValue = JsonValue.Boolean(value);

            _converter.ReadObject(jsonValue).Should().Be(value);
        }