Add deserializer tests

This commit is contained in:
yutopp 2019-01-18 22:41:56 +09:00
parent d2eff422b9
commit 07b4da51a9

View File

@ -252,6 +252,17 @@ namespace VRM
Assert.AreEqual(@"{}",json2);
}
// TODO: Move to another suitable location
[Test]
public void MetaDeserializeTest()
{
var json = @"{}";
var model = deserialize<glTF_VRM_Meta>(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<T>(string json)
{
return JsonUtility.FromJson<T>(json);
}
}
}