public void serialize_an_archer()
        {
            Arena arena = new Arena();
            Team  team  = new Team(arena, "blue", 125);

            Archer sut = new Archer(arena, team, 1);

            team.Units.Add(sut.Name, sut);
            team.Acount++;

            JToken jToken = sut.Serialize();

            Archer result = new Archer(arena, team, jToken);

            Assert.That(sut.Arena, Is.EqualTo(arena));
            Assert.That(result.Arena, Is.EqualTo(arena));

            Assert.That(sut.Team, Is.EqualTo(team));
            Assert.That(result.Team, Is.EqualTo(team));

            Assert.That(sut.Life == 12.0 && sut.Speed == 1.8);
            Assert.That(result.Life == 12.0 && result.Speed == 1.8);

            UnitTests_Unit.CheckEquals(sut, result);
        }
Exemple #2
0
        public void serialize_a_balista()
        {
            Arena arena = new Arena();
            Team  team  = arena.CreateTeam("blue");


            Balista sut = new Balista(arena, team, 1);

            JToken jToken = sut.Serialize();

            Balista result = new Balista(arena, team, jToken);

            UnitTests_Unit.CheckEquals(sut, result);
        }