protected override void ExecuteBehavior() { nullableTimes = JsonConvert.DeserializeObject <NullableTimes>( @" { ""TimeWithoutSeconds"":null, ""TimeWithSeconds"":null, ""TimeWithPositiveUtcOffset"":null, ""TimeWithNegativeUtcOffset"":null, ""TimeWithZSuffix"":null, ""TimeWithZSuffixWithoutSeconds"":null }"); serializedJsonForNullableTimes = JsonConvert.SerializeObject(nullableTimes); Console.WriteLine(serializedJsonForNullableTimes); }
protected override void ExecuteBehavior() { times = JsonConvert.DeserializeObject <Times>( @" { ""TimeWithoutSeconds"":""07:57"", ""TimeWithSeconds"":""07:57:32"", ""TimeWithPositiveUtcOffset"":""07:57:32+05:00"", ""TimeWithNegativeUtcOffset"":""07:57:32-05:00"", ""TimeWithZSuffix"":""07:57:32Z"", ""TimeWithZSuffixWithoutSeconds"":""07:57Z"" }"); nullableTimes = JsonConvert.DeserializeObject <NullableTimes>( @" { ""TimeWithoutSeconds"":""07:57"", ""TimeWithSeconds"":""07:57:32"", ""TimeWithPositiveUtcOffset"":""07:57:32+05:00"", ""TimeWithNegativeUtcOffset"":""07:57:32-05:00"", ""TimeWithZSuffix"":""07:57:32Z"", ""TimeWithZSuffixWithoutSeconds"":""07:57Z"" }"); rolloverTimes = JsonConvert.DeserializeObject <Times>( @" { ""TimeWithoutSeconds"":""07:57"", ""TimeWithSeconds"":""07:57:32"", ""TimeWithPositiveUtcOffset"":""03:57:32+05:00"", ""TimeWithNegativeUtcOffset"":""20:57:32-05:00"", ""TimeWithZSuffix"":""07:57:32Z"", ""TimeWithZSuffixWithoutSeconds"":""07:57Z"" }"); serializedJson = JsonConvert.SerializeObject(times); serializedJsonForNullableTimes = JsonConvert.SerializeObject(nullableTimes); }