Exemplo n.º 1
0
 public void Can_serialise_null_values_from_nested_expando_correctly()
 {
     JsConfig.IncludeNullValues = true;
     var foo = new FooSlash();
     var json = JsonSerializer.SerializeToString(foo);
     Assert.That(json, Is.EqualTo("{\"Nested\":null,\"Bar\":null}"));
     JsConfig.Reset();
 }
        public void Can_serialize_Dictionary_with_end_slash()
        {
            var foo = new FooSlash {
                Nested = new Dictionary <string, string> {
                    { "key", "value\"" }
                },
                Bar = "BarValue"
            };

            Serialize(foo);
        }
Exemplo n.º 3
0
        public void Can_serialize_ExpandoObject_with_end_slash()
        {
            dynamic nested = new ExpandoObject();
            nested.key = "value\"";

            var foo = new FooSlash
            {
                Nested = nested,
                Bar = "BarValue"
            };
            Serialize(foo);
        }
        public void Can_serialise_null_values_from_nested_dictionary_correctly()
        {
            JsConfig.IncludeNullValues = true;
            var foo = new FooSlash();
            var json = JsonSerializer.SerializeToString(foo);
            Assert.That(json, Is.EqualTo("{\"Nested\":null,\"Bar\":null}"));
			JsConfig.Reset();
		}
		public void Can_serialize_Dictionary_with_end_slash()
		{
			var foo = new FooSlash {
				Nested = new Dictionary<string, string> { { "key", "value\"" } },
				Bar = "BarValue"
			};
			Serialize(foo);
		}
Exemplo n.º 6
0
        public void Can_serialize_ExpandoObject_with_end_slash()
        {
            dynamic nested = new ExpandoObject();
            nested.key = "value\"";

            var foo = new FooSlash
            {
                Nested = nested,
                Bar = "BarValue"
            };
            Serialize(foo);
        }