Skip to content

Commit e435b28

Browse files
committed
Add test doc
1 parent 9f82b82 commit e435b28

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![Build status](https://ci.appveyor.com/api/projects/status/slry7u0dy894pevo/branch/master?svg=true)](https://ci.appveyor.com/project/veblush/json-net-unity3d/branch/master)
2+
13
# Newtonsoft Json.NET for Unity3D
24

35
[Newtonsoft Json.NET](http://www.newtonsoft.com/json) is a de facto standard JSON library in .NET ecosystem.
@@ -34,12 +36,23 @@ Following works are done to make Json.NET support Unity3D.
3436
- Remove XML support.
3537
- Remove JPath class to reduce size of DLL.
3638
- Remove DiagnosticsTraceWriter support.
39+
- Workaround for differences between Microsoft.NET & Unity3D-Mono.NET
3740

3841
For Unity.Lite version, additional works are done to make more lite.
3942

4043
- Remove JsonLinq (JToken, ...)
4144
- Remove Bson
4245

46+
## Unit Test
47+
48+
Tests in Json.NET are updated to be able to run under
49+
[UnityEditor Test Runner](http://docs.unity3d.com/Manual/testing-editortestsrunner.html).
50+
All tests pass under Microsoft .NET 3.5 but with UnityEditor some of them fail
51+
because there are not-implemented features and bugs in Unity3D-Mono framework.
52+
53+
Result:
54+
![Test status](https://raw.githubusercontent.com/SaladbowlCreative/Json.Net.Unity3D/master/docs/UnitTestSummary.png) [Detailed Description](./docs/UnitTest.md)
55+
4356
## FAQ
4457

4558
- Q: App stops throwing MissingMethodException for ComponentModel.TypeConverter like this.

docs/UnitTest.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# UnitTest
2+
3+
![Test](https://raw.githubusercontent.com/SaladbowlCreative/Json.Net.Unity3D/master/docs/UnitTestResult.png)
4+
5+
## What failed
6+
7+
### DateTimeFormat with CultureInfo doesn't cover all locale
8+
9+
##### ReadAsDateTimeOffsetIsoDate
10+
11+
```
12+
Expected: 08/01/2011 21:25:00 +00:00
13+
But was: 08/01/2011 21:25:00 +09:00
14+
---
15+
at Newtonsoft.Json.Tests.JsonTextReaderTest.ReadAsDateTimeOffsetIsoDate () [0x00085] in .\src\Newtonsoft.Json.Tests\JsonTextReaderTest.cs:2354
16+
```
17+
18+
### DateTimeOffset cannot parse formatted string well
19+
20+
##### SerializeFormattedDateTimeNewZealandCulture
21+
22+
```
23+
Expected string length 40 but was 32. Strings differ at index 1.
24+
Expected: ""Friday, 15 December 2000 10:11:03 p.m.""
25+
But was: ""15 December 2000 10:11:03 p.m.""
26+
------------^
27+
---
28+
at Newtonsoft.Json.Tests.Converters.IsoDateTimeConverterTests.SerializeFormattedDateTimeNewZealandCulture () [0x00070] in .\src\Newtonsoft.Json.Tests\Converters\IsoDateTimeConverterTests.cs:143
29+
```
30+
31+
##### DateFormatStringWithDateTimeOffset
32+
33+
```
34+
Newtonsoft.Json.JsonReaderException : Could not convert string to DateTimeOffset: 2000-pie-Dec-Friday-22. Path '', line 1, position 24.
35+
---
36+
at Newtonsoft.Json.JsonReader.ReadDateTimeOffsetString (System.String s) [0x0007d] in .\src\Newtonsoft.Json\JsonReader.cs:875
37+
at Newtonsoft.Json.JsonTextReader.ReadStringValue (ReadType readType) [0x001c7] in .\src\Newtonsoft.Json\JsonTextReader.cs:595
38+
at Newtonsoft.Json.JsonTextReader.ReadAsDateTimeOffset () [0x00000] in .\src\Newtonsoft.Json\JsonTextReader.cs:929
39+
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonContract contract, Boolean hasConverter) [0x00089] in .\src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:2250
40+
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, Boolean checkAdditionalContent) [0x00021] in .\src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:149
41+
```

0 commit comments

Comments
 (0)