Exemple #1
0
        public void ClampTest_ValInRangeRef_Success()
        {
            int num_r = 7;

            MathHelper.Clamp(ref num_r, 6, 10);
            Assert.AreEqual(num_r, 7);
        }
Exemple #2
0
        public void ClampTest_ValOutOfRangeFloatRef_Success()
        {
            float num_r = 3.89f;

            MathHelper.Clamp(ref num_r, 6.75f, 10.89f);
            Assert.AreEqual(num_r, 6.75f);
        }
Exemple #3
0
        public void NextPowerOfTwo_PositiveIntegerInt_Sucess()
        {
            int num = MathHelper.NextPowerOfTwo(5);

            Assert.AreEqual(num, 8);
        }
Exemple #4
0
        public void ClampTest_ValOutOfRangeFloat_Success()
        {
            float num = MathHelper.Clamp(3.89f, 6.75f, 10.89f);

            Assert.AreEqual(num, 6.75f);
        }
Exemple #5
0
        public void ClampTest_ValInRangeFloat_Success()
        {
            float num = MathHelper.Clamp(7.56f, 6.75f, 10.89f);

            Assert.AreEqual(num, 7.56f);
        }
Exemple #6
0
        public void ClampTest_ValInRange_Success()
        {
            int num = MathHelper.Clamp(7, 4, 10);

            Assert.AreEqual(num, 7);
        }
Exemple #7
0
        public void ClampTest_ValOutOfRange_Success()
        {
            int num = MathHelper.Clamp(3, 6, 10);

            Assert.AreEqual(num, 6);
        }
Exemple #8
0
        public void Log2_PositiveIntegerUint_Success()
        {
            uint num = MathHelper.Log2((uint)65);

            Assert.AreEqual(num, 6);
        }