Beispiel #1
0
        public void Should_create_value_from_instant_object()
        {
            var instant = Instant.FromUnixTimeSeconds(4123125455);

            Assert.Equal(instant.ToString(), JsonValue.Create((object)instant).ToString());
        }
Beispiel #2
0
 public void Should_throw_exception_if_creation_value_from_invalid_type()
 {
     Assert.Throws <ArgumentException>(() => JsonValue.Create(default(TimeSpan)));
 }
Beispiel #3
0
 public void Should_cache_zero()
 {
     Assert.Same(JsonValue.Zero, JsonValue.Create(0));
 }
Beispiel #4
0
 public void Should_create_boolean_from_object()
 {
     Assert.Equal(JsonValue.True, JsonValue.Create((object)true));
 }
Beispiel #5
0
 public void Should_cache_empty()
 {
     Assert.Same(JsonValue.Empty, JsonValue.Create(string.Empty));
 }
Beispiel #6
0
 public void Should_cache_false()
 {
     Assert.Same(JsonValue.False, JsonValue.Create(false));
 }
Beispiel #7
0
 public void Should_cache_true()
 {
     Assert.Same(JsonValue.True, JsonValue.Create(true));
 }
Beispiel #8
0
 public JsonObject Add(string key, object?value)
 {
     return(Add(key, JsonValue.Create(value)));
 }
Beispiel #9
0
 public void Should_throw_exception_when_creation_value_from_invalid_type()
 {
     Assert.Throws <ArgumentException>(() => JsonValue.Create(Guid.Empty));
 }