From aa7a974b8f15e31272d95fac25b348b0236f513f Mon Sep 17 00:00:00 2001 From: ousttrue Date: Wed, 6 Feb 2019 16:48:21 +0900 Subject: [PATCH] Add JsonUtilityTest --- .../VRM/UniGLTF/Editor/Tests/UniGLTFTests.cs | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Assets/VRM/UniGLTF/Editor/Tests/UniGLTFTests.cs b/Assets/VRM/UniGLTF/Editor/Tests/UniGLTFTests.cs index b9d567742..d46ed821f 100644 --- a/Assets/VRM/UniGLTF/Editor/Tests/UniGLTFTests.cs +++ b/Assets/VRM/UniGLTF/Editor/Tests/UniGLTFTests.cs @@ -667,5 +667,31 @@ namespace UniGLTF GameObject.DestroyImmediate(go); } } + + [Serializable] + class CantConstruct + { + public bool Value = true; + + public CantConstruct(bool value) + { + throw new Exception(); + } + } + + [Serializable] + class Dummy + { + public CantConstruct Value; + } + + + [Test] + public void JsonUtilityTest() + { + var dummy = JsonUtility.FromJson("{}"); + Assert.NotNull(dummy.Value); + Assert.False(dummy.Value.Value); + } } }