From 07b4da51a96289c520fd6bd3629dbda0abbd6955 Mon Sep 17 00:00:00 2001 From: yutopp Date: Fri, 18 Jan 2019 22:41:56 +0900 Subject: [PATCH] Add deserializer tests --- .../UniVRM/Editor/Tests/UniVRMSerializeTests.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Assets/VRM/UniVRM/Editor/Tests/UniVRMSerializeTests.cs b/Assets/VRM/UniVRM/Editor/Tests/UniVRMSerializeTests.cs index 7842a9119..deb4fed5e 100644 --- a/Assets/VRM/UniVRM/Editor/Tests/UniVRMSerializeTests.cs +++ b/Assets/VRM/UniVRM/Editor/Tests/UniVRMSerializeTests.cs @@ -252,6 +252,17 @@ namespace VRM Assert.AreEqual(@"{}",json2); } + // TODO: Move to another suitable location + [Test] + public void MetaDeserializeTest() + { + var json = @"{}"; + + var model = deserialize(json); + + Assert.AreEqual(-1, model.texture); + } + [Test] public void SecondaryAnimationColliderTest() { @@ -381,5 +392,11 @@ namespace VRM // NOTE: New serializer outputs values which will not be used... Assert.AreEqual(json,json2); } + + // TODO: Move to another suitable location + T deserialize(string json) + { + return JsonUtility.FromJson(json); + } } }