Example #1
0
        public void BattlePageTwo_Apply_Ability_Clicked_Navigation_Should_Pass()
        {
            // Arrange
            BattleEngineViewModel.Instance.Engine.EngineSettings.CurrentAttacker.EngineGameSpecialAbility = AbilityEnum.Bribes;
            BattlePageTwo page1 = new BattlePageTwo();

            page1.Navigation.PushAsync(new HomePage());
            page1.Navigation.PushAsync(new GamePage());
            page1.Navigation.PushAsync(new PickCharactersPage());

            // Act
            page1.Apply_Ability_Clicked(null, null);

            // Reset

            // Assert
            Assert.IsTrue(true); // Got to here, so it happened...
        }
Example #2
0
        public void Setup()
        {
            // Initilize Xamarin Forms
            MockForms.Init();

            //This is your App.xaml and App.xaml.cs, which can have resources, etc.
            app = new App();
            Application.Current = app;

            // For now, set the engine to the Koenig Engine, change when ready
            //BattleEngineViewModel.Instance.SetBattleEngineToKoenig();
            BattleEngineViewModel.Instance.SetBattleEngineToGame();

            // Put seed data into the system for all tests
            BattleEngineViewModel.Instance.Engine.Round.ClearLists();
            CharacterModel TestCharacter = new CharacterModel
            {
                Name         = "TestCharacterName",
                TileImageURI = Constants.SpecificCharacterTypeDefaultTileImageURI,
                SpecificCharacterTypeEnum = SpecificCharacterTypeEnum.SmartyPants,
                PrimaryHand = ItemIndexViewModel.Instance.GetDefaultItemTypeItemId(ItemTypeEnum.Notebook),
            };

            MonsterModel TestMonster = new MonsterModel
            {
                Id                      = "TestMonsterId",
                Name                    = "TestMonsterName",
                TileImageURI            = Constants.SpecificMonsterTypeAssistantProfessorTileImageURI,
                SpecificMonsterTypeEnum = SpecificMonsterTypeEnum.AssistantProfessor,
            };

            PlayerInfoModel TestPlayerMonster = new PlayerInfoModel(TestMonster);

            TestPlayerMonster.Id = "TestMonsterPlayerId";

            BattleEngineViewModel.Instance.Engine.EngineSettings.MonsterList.Add(TestPlayerMonster);

            BattleEngineViewModel.Instance.Engine.Round.SetCurrentAttacker(new PlayerInfoModel(TestCharacter));
            BattleEngineViewModel.Instance.Engine.Round.SetCurrentDefender(TestPlayerMonster);
            //Start the Engine in AutoBattle Mode
            //BattleEngineViewModel.Instance.Engine.StartBattle(false);

            page = new BattlePageTwo();
        }