public TestType() { Random = new Random(); Thing1 = (byte)Random.Next(); Thing2 = new byte[128]; Random.NextBytes(Thing2); Thing3 = Random.Next(); Thing4 = new int[128]; for (int i = 0; i < Thing4.Length; i++) { Thing4[i] = Random.Next(); } Thing5 = (short)Random.Next(); Thing6 = Random.Next(); Thing7 = Random.NextDouble(); Thing8 = (float)Random.NextDouble(); Thing9 = GenerateRandomString(); Thing10 = new string[16]; for (int i = 0; i < 16; i++) { Thing10[i] = GenerateRandomString(); } Thing11 = new ItemStack(1, 2, 3); Custom = new CustomSerializable(); }
public void SerializationUtilityCanDeserializeCustomSerializable() { CustomSerializable deserializedInstance = SerializationUtility.DeserializeFromString("testcontents", typeof(CustomSerializable), ApplicationNode.Hierarchy) as CustomSerializable; Assert.IsNotNull(deserializedInstance); Assert.AreEqual("testcontents", deserializedInstance.Contents); }
public TestType() { Random = new Random(); Thing1 = (byte)Random.Next(); Thing2 = new byte[128]; Random.NextBytes(Thing2); Thing3 = Random.Next(); Thing4 = new int[128]; for (int i = 0; i < Thing4.Length; i++) Thing4[i] = Random.Next(); Thing5 = (short)Random.Next(); Thing6 = Random.Next(); Thing7 = Random.NextDouble(); Thing8 = (float)Random.NextDouble(); Thing9 = GenerateRandomString(); Thing10 = new string[16]; for (int i = 0; i < 16; i++) Thing10[i] = GenerateRandomString(); Thing11 = new ItemStack(1, 2, 3); Custom = new CustomSerializable(); }
public void SerializationUtilityCanSerializeCustomSerializable() { CustomSerializable serializable = new CustomSerializable("testcontents"); Assert.AreEqual("testcontents", SerializationUtility.SerializeToString(serializable, ApplicationNode.Hierarchy)); }