//Can't use [TestCase] or [TestCaseSource] //because of IL2CPP AOT compilation async Task Test <T>(T data) { var result = await UnityJsonSP.SerializeAsync(data); Assert.AreEqual(data.ToJson().ToBytes(), result); var resultJson = result.FromBytes(); Assert.AreEqual(data.ToJson(), resultJson); }
public void SerializationProvider_Serialize() { //Can't use [TestCase] or [TestCaseSource] //because of IL2CPP AOT compilation void Test <T>(T data) { var result = UnityJsonSP.Serialize(data); Assert.AreEqual(data.ToJson().ToBytes(), result); var resultJson = result.FromBytes(); Assert.AreEqual(data.ToJson(), resultJson); } Test(GenericDataVector); Test(GenericDataStruct); }