public void WriteValueIJsonSerializable()
        {
            var sb           = new StringBuilder();
            var stringWriter = new StringWriter(sb);
            var jsonWriter   = new JsonWriter(stringWriter);

            var test = new TestIJsonSerializable();

            jsonWriter.WriteValue(test);

            Assert.AreEqual(test.ToJson(), sb.ToString());
        }
Пример #2
0
        public void WriteValueIJsonSerializable()
        {
            var sb = new StringBuilder();
            var stringWriter = new StringWriter(sb);
            var jsonWriter = new JsonWriter(stringWriter);

            var test = new TestIJsonSerializable();
            jsonWriter.WriteValue(test);

            Assert.AreEqual(test.ToJson(), sb.ToString());
        }