public void Should_not_use_interface_type_if_concrete_specified () {
			JsConfig.PreferInterfaces = false;
			IContract myConcrete = new Concrete("boo", 1);
			var json = JsonSerializer.SerializeToString(myConcrete, typeof(IContract));

			Console.WriteLine(json);
			Assert.That(json, Is.StringContaining("\"ServiceStack.Text.Tests.JsonTests.Concrete, ServiceStack.Text.Tests\""));
		}
		public void Should_be_able_to_serialise_based_on_an_interface () {
			JsConfig.PreferInterfaces = true;
			IContract myConcrete = new Concrete("boo", 1);
			var json = JsonSerializer.SerializeToString(myConcrete, typeof(IContract));

			Console.WriteLine(json);
			Assert.That(json, Is.StringContaining("\"ServiceStack.Text.Tests.JsonTests.IContract, ServiceStack.Text.Tests\""));
		}
        public void Prefer_interfaces_should_work_on_top_level_object_using_extension_method()
        {
            using (JsConfig.With(preferInterfaces:true))
            {
                var json = new Concrete("boo", 1).ToJson();

                Assert.That(json, Is.StringContaining("\"ServiceStack.Text.Tests.JsonTests.IContract, ServiceStack.Text.Tests\""));
            }
        }
		public void Should_be_able_to_deserialise_based_on_an_interface_with_no_concrete () {
			JsConfig.PreferInterfaces = true;
			var json = new Concrete("boo", 42).ToJson();

			// break the typing so we have to use the dynamic implementation
			json = json.Replace("ServiceStack.Text.Tests.JsonTests.IContract", "ServiceStack.Text.Tests.JsonTests.IIdenticalContract");

			var result = JsonSerializer.DeserializeFromString<IIdenticalContract>(json);

			Assert.That(result.StringValue, Is.EqualTo("boo"));
			Assert.That(result.ChildProp.IntValue, Is.EqualTo(42));
		}