コード例 #1
0
        public void WorldLocationOperatorTest()
        {
            WorldLocation location1 = new WorldLocation();
            WorldLocation location2 = new WorldLocation(1, 1, Microsoft.Xna.Framework.Vector3.One);

            Assert.IsTrue(location1.Equals(WorldLocation.None));
            Assert.IsTrue(location1 != location2);

            Assert.IsFalse(Equals(WorldLocation.None.Equals(new object())));
        }
コード例 #2
0
ファイル: CoordinatesTests.cs プロジェクト: Reve/ORTS-MG
        public void WorldLocationSerializationTest()
        {
            WorldLocation location1 = new WorldLocation(-17, 13, -45.3f, 62.8f, 91.7f);
            WorldLocation location2;

            using (BinaryWriter writer = new BinaryWriter(new MemoryStream()))
            {
                WorldLocation.Save(location1, writer);
                writer.BaseStream.Position = 0;
                using (BinaryReader reader = new BinaryReader(writer.BaseStream))
                {
                    location2 = WorldLocation.Restore(reader);
                }
            }

            Assert.IsTrue(WorldLocation.Equals(location1, location2));
        }