Skip to content

Commit b613e51

Browse files
committed
More docs about unit-test
1 parent f4a4113 commit b613e51

File tree

3 files changed

+46
-11
lines changed

3 files changed

+46
-11
lines changed

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,19 @@ Tests in Json.NET are updated to be able to run under
5050
All tests pass under Microsoft .NET 3.5 but with UnityEditor some of them fail
5151
because there are not-implemented features and bugs in Unity3D-Mono framework.
5252

53-
Result:
54-
![Test status](https://raw.githubusercontent.com/SaladbowlCreative/Json.Net.Unity3D/master/docs/UnitTestSummary.png) [Detailed Description](./docs/UnitTest.md)
53+
Test Result:
54+
55+
| Profile |:white_check_mark: Passed | :x: Failed | :white_circle: Ignored |
56+
| :------------- | -----------------------: | ---------: | ---------------------: |
57+
| Microsoft.NET | 1448 | 0 | 1 |
58+
| Unity3D-Mono | 1435 | 13 | 1 |
59+
60+
Detailed Description is [here](./docs/UnitTest.md) to tell you what failed and why.
61+
62+
## Unity Compatibility
63+
64+
This library is tested on Unity 4.7, 5.2 and 5.3. For AOT environment like iOS, you
65+
need to use IL2CPP instead of obsolute Mono-AOT because IL2CPP handles generic code better than Mono-AOT. With Mono-AOT configuration, AOT related exception would be thrown.
5566

5667
## FAQ
5768

docs/UnitTest.md

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,43 @@
22

33
![Test](https://raw.githubusercontent.com/SaladbowlCreative/Json.Net.Unity3D/master/docs/UnitTestResult.png)
44

5-
## What failed
6-
7-
### DateTimeFormat with CultureInfo doesn't cover all locale
8-
9-
##### ReadAsDateTimeOffsetIsoDate
5+
## Failed tests
6+
7+
- Newtonsoft.Json.Tests.Converters.IsoDateTimeConverterTests
8+
- SerializeFormattedDateTimeNewZealandCulture
9+
- Newtonsoft.Json.Tests.JsonConvertTest
10+
- WriteDateTime
11+
- Newtonsoft.Json.Tests.JsonTextReaderTest
12+
- ReadAsDateTimeOffsetIsoDate
13+
- Newtonsoft.Json.Tests.Linq.JTokenReaderTest
14+
- ReadAsDateTimeOffset_String
15+
- ReadAsDateTimeOffsetString
16+
- Newtonsoft.Json.Tests.Serialization.JsonSerializerTest
17+
- DateFormatStringWithDateTimeOffset
18+
- DateFormatStringWithDictionaryKey_DateTimeOffset
19+
- DateFormatStringWithDictionaryKey_DateTimeOffset_ReadAhead
20+
- DateTimeDictionaryKey_DateTime_Iso
21+
- DateTimeDictionaryKey_DateTime_Iso_Local
22+
- DateTimeDictionaryKey_DateTimeOffset_Iso
23+
- Newtonsoft.Json.Tests.Utilities.DateTimeUtilsTests
24+
- NewDateTimeOffsetParse
25+
- NewDateTimeParse
26+
27+
## Why did tests fail?
28+
29+
Most of them failed because DateTime and DateTimeOffset in Unity3D-Mono
30+
cannot handle UTC formatted string well. (postfix Z or +09:00, fraction part of ISO time.)
31+
32+
For example, ReadAsDateTimeOffsetIsoDate failed with this message because
33+
DateTimeOffset didn't get UTC timezone in parsing "2011-08-01T21:25Z".
1034

1135
```
1236
Expected: 08/01/2011 21:25:00 +00:00
1337
But was: 08/01/2011 21:25:00 +09:00
1438
```
1539

16-
### DateTimeOffset cannot parse formatted string well
17-
18-
##### SerializeFormattedDateTimeNewZealandCulture
40+
SerializeFormattedDateTimeNewZealandCulture failed because DateTime in Unity3D-Mono
41+
generated different date-time string from .NET one.
1942

2043
```
2144
Expected string length 40 but was 32. Strings differ at index 1.
@@ -24,7 +47,8 @@ Expected string length 40 but was 32. Strings differ at index 1.
2447
------------^
2548
```
2649

27-
##### DateFormatStringWithDateTimeOffset
50+
DateFormatStringWithDateTimeOffset failed because DateTimeOffset in Unity3D-Mono
51+
cannot parse user-defined time format well such as "yyyy'-pie-'MMM'-'dddd'-'dd".
2852

2953
```
3054
Newtonsoft.Json.JsonReaderException : Could not convert string to DateTimeOffset:

docs/UnitTestResult.png

-394 Bytes
Loading

0 commit comments

Comments
 (0)