예제 #1
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;

            page = new NewRoundPage();
        }
예제 #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();

            page = new NewRoundPage();
        }
        public void NewRoundPage_Constructor_RoundCount_Greater_Than_1_Should_Pass()
        {
            // Arrange
            var save = BattleEngineViewModel.Instance.Engine.EngineSettings.BattleScore.RoundCount;

            BattleEngineViewModel.Instance.Engine.EngineSettings.BattleScore.RoundCount = 2;

            // Act
            var result = new NewRoundPage();

            // Reset
            BattleEngineViewModel.Instance.Engine.EngineSettings.BattleScore.RoundCount = save;

            // Assert
            Assert.IsNotNull(result);
        }
        public void NewRoundPage_BeginGridButton_Clicked_Navigation_Should_Pass()
        {
            // Arrange
            NewRoundPage page1 = new NewRoundPage();

            page1.Navigation.PushAsync(new HomePage());
            page1.Navigation.PushAsync(new GamePage());
            page1.Navigation.PushAsync(new PickCharactersPage());
            page1.UnitTestSetting = true;

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

            // Reset

            // Assert
            Assert.IsTrue(true); // Got to here, so it happened...
        }
        public void NewRoundPage_NewRoundPage_CharacterList_MonsterList_Should_Pass()
        {
            // Arrange
            // Act

            BattleEngineViewModel.Instance.Engine.EngineSettings.CharacterList = new List <PlayerInfoModel>();
            BattleEngineViewModel.Instance.Engine.EngineSettings.CharacterList.Add(new PlayerInfoModel(new CharacterModel()));

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

            var result = new NewRoundPage();

            // Reset

            // Assert
            Assert.IsNotNull(result); // Got to here, so it happened...
        }
        public void NewRoundPage_BeginSimpleButton_Clicked_Navigation_Should_Pass()
        {
            // Arrange
            NewRoundPage page1 = new NewRoundPage();

            page1.Navigation.PushAsync(new HomePage());
            page1.Navigation.PushAsync(new GamePage());
            page1.Navigation.PushAsync(new PickCharactersPage());
            page1.nextPlayer = new PlayerInfoModel {
                PlayerType = PlayerTypeEnum.Character
            };

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

            // Reset
            page.nextPlayer = null;

            // Assert
            Assert.IsTrue(true); // Got to here, so it happened...
        }