コード例 #1
0
        public void ConvertFromFloatToIntRoundsDownWhenLessThanFiveNegative()
        {
            int   expected      = -0;
            float startingFloat = -0.4999f;

            int actual = GridMath.ConvertFromFloatToInt(startingFloat);

            Assert.Equal(expected, actual);
        }
コード例 #2
0
        public void ConvertFromFloatToIntRoundsDownWhenLessThanFive()
        {
            var expected      = 0;
            var startingFloat = 0.4999f;

            int actual = GridMath.ConvertFromFloatToInt(startingFloat);

            Assert.Equal(expected, actual);
        }
コード例 #3
0
        public void ConvertFromFloatToIntCanRoundAndConvertNegativeCorrectly()
        {
            int   expected      = -1;
            float startingFloat = -0.51f;

            int actual = GridMath.ConvertFromFloatToInt(startingFloat);

            Assert.Equal(expected, actual);
        }
コード例 #4
0
        public void ConvertFromFloatToIntCanRoundAndConvertCorrectly()
        {
            var expected      = 1;
            var startingFloat = 0.51f;

            int actual = GridMath.ConvertFromFloatToInt(startingFloat);

            Assert.Equal(expected, actual);
        }