예제 #1
0
        public void PickCharactersPage_CreateEngineCharacterList_Default_Should_Pass()
        {
            // Arrange
            BattleEngineViewModel.Instance.Engine.CharacterList = new List <PlayerInfoModel>();
            BattleEngineViewModel.Instance.Engine.CharacterList.Add(new PlayerInfoModel(new CharacterModel()));

            BattleEngineViewModel.Instance.Engine.MonsterList = new List <PlayerInfoModel>();
            BattleEngineViewModel.Instance.Engine.MonsterList.Add(new PlayerInfoModel(new MonsterModel()));

            BattleEngineViewModel.Instance.PartyCharacterList = new ObservableCollection <CharacterModel>();
            BattleEngineViewModel.Instance.PartyCharacterList.Add(new CharacterModel());

            // Act
            page.CreateEngineCharacterList();

            // Reset

            // Assert
            Assert.IsTrue(true); // Got to here, so it happened...
        }
예제 #2
0
        public void HackathonScenario_Scenario_30_First_Battle_Character_Is_Buffed()
        {
            /*
             * Scenario Number:
             *  30
             *
             * Description:
             *      The first character in the player list gets their base Attack, Speed, Defense values
             *      buffed by 2x for the time they are the first in the list.
             *
             * Changes Required (Classes, Methods etc.)  List Files, Methods, and Describe Changes:
             *     PickCharactersPage
             *     CreateEngineCharacterList()
             *
             * Test Algrorithm:
             *  Create list of Picked Characters with some Attack, Defense, Speed Attribute values
             *  Call method CreateEngineCharacterList() to copy Picked characters to Engine.CharacterList
             *
             *
             * Test Conditions:
             *  Test Attack attribute of first character from Engine.CharacterList
             *  Test Defense attribute of first character from Engine.CharacterList
             *  Test Speed attribute of first character from Engine.CharacterList
             *
             *
             * Validation:
             *      Verify the Attack attribute of the first charater to be doubled from Engine.CharacterList
             *      Verify the Defense attribute of the first charater to be doubled from Engine.CharacterList
             *      Verify the Speed attribute of the first charater to be doubled from Engine.CharacterList
             *
             *
             *
             */

            //Arrange
            // Set Character Conditions

            var CharacterModel1 =
                new CharacterModel
            {
                Level         = 10,
                CurrentHealth = 200,
                MaxHealth     = 200,
                Experience    = 100,
                Name          = "Rabbit",
                Attack        = 100,
                Speed         = 100,
                Defense       = 100
            };

            var CharacterModel2 =
                new CharacterModel
            {
                Level         = 8,
                CurrentHealth = 300,
                MaxHealth     = 300,
                Experience    = 100,
                Name          = "Pig",
                Attack        = 50,
                Speed         = 50,
                Defense       = 50
            };

            PickCharactersPage.EngineViewModel = BattleEngineViewModel.Instance;
            PickCharactersPage.EngineViewModel.PartyCharacterList = new ObservableCollection <CharacterModel>();
            PickCharactersPage.EngineViewModel.PartyCharacterList.Add(CharacterModel1);
            PickCharactersPage.EngineViewModel.PartyCharacterList.Add(CharacterModel2);

            // Create CharacterList
            PickCharactersPage.CreateEngineCharacterList();

            //Assert
            Assert.AreEqual(200, PickCharactersPage.EngineViewModel.Engine.CharacterList.First().Attack);
            Assert.AreEqual(200, PickCharactersPage.EngineViewModel.Engine.CharacterList.First().Defense);
            Assert.GreaterOrEqual(PickCharactersPage.EngineViewModel.Engine.CharacterList.First().Speed, 200);
        }