Exemplo n.º 1
0
        public void RoundtripGameDefinition()
        {
            var expected = new GameDefinition
            {
                Id       = Guid.NewGuid().ToString(),
                Title    = Guid.NewGuid().ToString(),
                LevelIds = new[]
                {
                    Guid.NewGuid().ToString(),
                Guid.NewGuid().ToString(),
                Guid.NewGuid().ToString(),
                },
            };

            var xml = expected.ToString();

            Assert.IsFalse(string.IsNullOrEmpty(xml));

            var actual = GameDefinition.FromString(xml);

            Assert.IsNotNull(actual);
            Assert.AreEqual(expected.Id, actual.Id);
            Assert.AreEqual(expected.Title, actual.Title);
            Assert.AreEqual(expected.LevelIds.Length, actual.LevelIds.Length);
        }