mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-23 03:16:12 -05:00
Add JsonDictionaryDeserializerTest
This commit is contained in:
parent
9db72cd69a
commit
0eff571b60
|
|
@ -138,18 +138,29 @@ namespace UniJSON
|
|||
DeserializeValue(new List<int> { 1 }, "[1]");
|
||||
//DeserializeValue(new object[] { null, 1, "a" }, "[null,1,\"a\"]");
|
||||
|
||||
DeserializeValue(new Dictionary<string, object> { }, "{}");
|
||||
DeserializeValue(new Dictionary<string, object> { { "a", 1 } }, "{\"a\":1}");
|
||||
DeserializeValue(new Dictionary<string, object> { { "a",
|
||||
new Dictionary<string, object>{
|
||||
} } }, "{\"a\":{}}");
|
||||
|
||||
DeserializeValue(new Point { X = 1 }, "{\"X\":1,\"Y\":0}");
|
||||
|
||||
DeserializeValue(HogeFuga.Fuga, "1");
|
||||
|
||||
DeserializeValue(new EnumTest(), "{\"EnumDefault\":0,\"EnumAsInt\":0,\"EnumAsString\":\"Hoge\",\"EnumAsLowerString\":\"hoge\"}");
|
||||
}
|
||||
|
||||
class DictionaryValue
|
||||
{
|
||||
public Dictionary<string, object> Dict;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void JsonDictionaryDeserializerTest()
|
||||
{
|
||||
DeserializeValue(new Dictionary<string, object> { }, "{}");
|
||||
DeserializeValue(new Dictionary<string, object> { { "a", 1 } }, "{\"a\":1}");
|
||||
DeserializeValue(new Dictionary<string, object> { { "a",
|
||||
new Dictionary<string, object>{
|
||||
} } }, "{\"a\":{}}");
|
||||
|
||||
DeserializeValue(new DictionaryValue(), "{\"Dict\": {}}");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user