public void MapLayerMessage() { MapLayerReplyVariant s = new MapLayerReplyVariant(); s.Flags = 1; MapLayerReplyVariant.LayerData[] blocks = new MapLayerReplyVariant.LayerData[2]; MapLayerReplyVariant.LayerData block = new MapLayerReplyVariant.LayerData(); block.ImageID = UUID.Random(); block.Bottom = 1; block.Top = 2; block.Left = 3; block.Right = 4; blocks[0] = block; block.ImageID = UUID.Random(); block.Bottom = 5; block.Top = 6; block.Left = 7; block.Right = 9; blocks[1] = block; s.LayerDataBlocks = blocks; OSDMap map = s.Serialize(); MapLayerReplyVariant t = new MapLayerReplyVariant(); t.Deserialize(map); Assert.AreEqual(s.Flags, t.Flags); for (int i = 0; i < s.LayerDataBlocks.Length; i++) { Assert.AreEqual(s.LayerDataBlocks[i].ImageID, t.LayerDataBlocks[i].ImageID); Assert.AreEqual(s.LayerDataBlocks[i].Top, t.LayerDataBlocks[i].Top); Assert.AreEqual(s.LayerDataBlocks[i].Left, t.LayerDataBlocks[i].Left); Assert.AreEqual(s.LayerDataBlocks[i].Right, t.LayerDataBlocks[i].Right); Assert.AreEqual(s.LayerDataBlocks[i].Bottom, t.LayerDataBlocks[i].Bottom); } }