4
이 테스트 케이스가 실패했습니다. 누구나 그것을 고칠 줄 알아?json.net은 IsoFormat에서 datestring을 비 직렬화합니다.
[TestMethod]
public void Should_deserialize_utc_datestring_to_utc_date_with_AlwaysUseUtc_true()
{
string dateString = "2014-06-02T21:00:00.0000000Z";
DateTime dateRaw = new DateTime(2014, 6, 2, 21, 0, 0, 0, DateTimeKind.Utc);
JsonSerializerSettings settings = new JsonSerializerSettings();
settings.DateTimeZoneHandling = DateTimeZoneHandling.Utc;
settings.DateFormatHandling = DateFormatHandling.IsoDateFormat;
DateTime dateSerialized = JsonConvert.DeserializeObject<DateTime>(dateString, settings);
dateSerialized.Should().Be(dateRaw);
}
나는 (내의 TestRunner로 ReSharper에서 사용) 점점 오전 오류 : Newtonsoft.Json.JsonReaderException : 수를 분석하는 동안 발생하는 예기치 않은 문자 : 예외를 던졌다 When_json_serializing_dates.Should_deserialize_utc_datestring_to_utc_date_with_AlwaysUseUtc_true
시험 방법 T. 경로 ', 줄 1, 위치 10입니다.
감사합니다! 그 트릭을했다. – Raymond