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); } }
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); } }