コード例 #1
0
        public void Character_ScaleLevel_Level_2_Forced_5_Should_Return_MaxHealth_10()
        {
            //Health, Attack, Defense, Speed
            int[] BaseClassBaseStats    = { 5, 4, 3, 4 };
            int[] MageClassBaseStats    = { 4, 7, 3, 4 };
            int[] KnightClassBaseStats  = { 6, 6, 6, 2 };
            int[] AssasinClassBaseStats = { 3, 5, 3, 8 };

            // Base stats.
            int[][] ClassBaseStats = { BaseClassBaseStats, MageClassBaseStats, KnightClassBaseStats, AssasinClassBaseStats };

            // Arrange
            var Test     = new Character();
            int Level    = 2;
            int Expected = ClassBaseStats[Test.ClassCode()][0] + 5;  // Expected MaxHealth

            // Turn on Forced Values
            GameGlobals.SetForcedRandomNumbersValue(5);

            // Act
            var Actual = Test.ScaleLevel(Level);

            // Reset
            GameGlobals.DisableRandomValues();

            // Assert
            Assert.AreEqual(Expected, Test.GetHealthMax(), TestContext.CurrentContext.Test.Name);
        }
コード例 #2
0
        // Debug Switches

        /// <summary>
        /// Turn on Random Number Forced Values
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void UseForcedRandomValuesSwitch_OnToggled(object sender, ToggledEventArgs e)
        {
            if (e.Value)
            {
                ForcedRandomValuesSettingsFrame.IsVisible = true;
                GameGlobals.EnableRandomValues();

                GameGlobals.SetForcedRandomNumbersValue(Convert.ToInt16(ForcedValue.Text));
            }
            else
            {
                GameGlobals.DisableRandomValues();
                ForcedRandomValuesSettingsFrame.IsVisible = false;
            }
        }
コード例 #3
0
        public void Character_ScaleLevel_Level_2_Forced_5_Should_Return_MaxHealth_10()
        {
            // Arrange
            var Test     = new Character();
            int Level    = 2;
            int Expected = 10;  // Expected MaxHealth

            // Turn on Forced Values
            GameGlobals.SetForcedRandomNumbersValue(5);

            // Act
            var Actual = Test.ScaleLevel(Level);

            // Reset
            GameGlobals.DisableRandomValues();

            // Assert
            Assert.AreEqual(Expected, Test.GetHealthMax(), TestContext.CurrentContext.Test.Name);
        }