public void XMLSerializationTest() { var position = new Vector3 (); position.x = (Mathf.Sqrt (5) + 1.0f) / 2.0f; var serialized = new XMLDeSerializer<Vector3> (position); Assert.AreEqual (serialized.Data, position); Assert.IsNotEmpty (serialized.Serialized); var deserialized = new XMLDeSerializer<Vector3> (serialized.Serialized); Assert.AreEqual (serialized.Serialized, deserialized.Serialized); Assert.AreEqual (position, deserialized.Data); }
public void XMLerializationMassTest() { var generatorCount = 421337u; var positions = new List<Vector3> (); for (var i = 0u; i < generatorCount; ++i) { positions.Add (new Vector3 (i, i, i)); } var serialized = new XMLDeSerializer<List<Vector3>> (positions); Assert.AreEqual (serialized.Data, positions); Assert.IsNotEmpty (serialized.Serialized); var deserialized = new XMLDeSerializer<List<Vector3>> (serialized.Serialized); Assert.AreEqual (serialized.Serialized, deserialized.Serialized); Assert.AreEqual (new Vector3 (1337, 1337, 1337), positions[1337]); }
public void XMLNonSerializableTest() { var v = new Vector2 (12, 13); var s = new XMLDeSerializer<Vector2> (v); var d = new XMLDeSerializer<Vector2> (s.Serialized); Assert.AreEqual (v, d.Data); }