예제 #1
0
        public void XmlObjects_ConvertClassToXml_PlayerShouldReturnValidXml()
        {
            Player player = new Player();
            player.Name = "Goran";
            player.Server = "ts19.travian.se";

            Village v1 = new Village();
            v1.Name = "village 1";
            v1.Player = player;
            v1.Inhabitants = 100;

            player.Villages = new List<Village>();
            player.Villages.Add(v1);

            string xml = XmlObjects.ConvertClassToXml<Player>(player);

            Assert.IsTrue(xml.Contains("<api"));
        }
예제 #2
0
파일: ApiRoot.cs 프로젝트: gahman/travian
 public ApiRoot(Player player)
     : base()
 {
     this.Player = player;
     this.Villages = player.Villages;
 }