コード例 #1
0
        public void WriteJsonException()
        {
            StringBuilder sb = new StringBuilder();
            StringWriter  sw = new StringWriter(sb);

            using (JsonWriter writer = new JsonTextWriter(sw))
            {
                DateTimeJsonConverter converter = new DateTimeJsonConverter();
                converter.WriteJson(writer, "", null);
            }
        }
コード例 #2
0
        public void WriteJson()
        {
            StringBuilder sb = new StringBuilder();
            StringWriter  sw = new StringWriter(sb);

            using (JsonWriter writer = new JsonTextWriter(sw))
            {
                DateTimeJsonConverter converter = new DateTimeJsonConverter();
                converter.WriteJson(writer, DateTime.Today, null);
                Assert.IsNotNull(converter);
            }
        }