public void TestCPGPSResponse() { CPGPSResponse res = new CPGPSResponse(); res.DestType = BaseResponse.DEST_TYPE.PLAYER; res.Destination = new List<long>() { 2350982 }; res.CPs.Add(new CPGPSResponse.CPGPS() { x = 1000, y = 2000, z = 3000, name = "Test1" }); res.CPs.Add(new CPGPSResponse.CPGPS() { x = 4000, y = 5000, z = 6000, name = "Test2" }); byte[] buffer = res.serialize(); CPGPSResponse res2 = new CPGPSResponse(); res2.deserialize(new VRage.ByteStream(buffer, buffer.Length)); Assert.AreEqual(res.MsgType, res2.MsgType); Assert.AreEqual(res.DestType, res2.DestType); CollectionAssert.AreEqual(res.Destination, res2.Destination); Assert.AreEqual(res.CPs[0].x, res2.CPs[0].x); Assert.AreEqual(res.CPs[0].y, res2.CPs[0].y); Assert.AreEqual(res.CPs[0].z, res2.CPs[0].z); Assert.AreEqual(res.CPs[0].name, res2.CPs[0].name); Assert.AreEqual(res.CPs[1].x, res2.CPs[1].x); Assert.AreEqual(res.CPs[1].y, res2.CPs[1].y); Assert.AreEqual(res.CPs[1].z, res2.CPs[1].z); Assert.AreEqual(res.CPs[1].name, res2.CPs[1].name); }
public void TestCPGPSResponse() { CPGPSResponse res = new CPGPSResponse(); res.DestType = BaseResponse.DEST_TYPE.PLAYER; res.Destination = new List <long>() { 2350982 }; res.CPs.Add(new CPGPSResponse.CPGPS() { x = 1000, y = 2000, z = 3000, name = "Test1" }); res.CPs.Add(new CPGPSResponse.CPGPS() { x = 4000, y = 5000, z = 6000, name = "Test2" }); byte[] buffer = res.serialize(); CPGPSResponse res2 = new CPGPSResponse(); res2.deserialize(new VRage.ByteStream(buffer, buffer.Length)); Assert.AreEqual(res.MsgType, res2.MsgType); Assert.AreEqual(res.DestType, res2.DestType); CollectionAssert.AreEqual(res.Destination, res2.Destination); Assert.AreEqual(res.CPs[0].x, res2.CPs[0].x); Assert.AreEqual(res.CPs[0].y, res2.CPs[0].y); Assert.AreEqual(res.CPs[0].z, res2.CPs[0].z); Assert.AreEqual(res.CPs[0].name, res2.CPs[0].name); Assert.AreEqual(res.CPs[1].x, res2.CPs[1].x); Assert.AreEqual(res.CPs[1].y, res2.CPs[1].y); Assert.AreEqual(res.CPs[1].z, res2.CPs[1].z); Assert.AreEqual(res.CPs[1].name, res2.CPs[1].name); }