Beispiel #1
0
        public void RoundTest()
        {
            //check Round(double a, int decimalPlace)
            Assert.AreEqual(6.4, OwnMath.round(6.42, 1));
            Assert.AreEqual(6.5, OwnMath.round(6.46, 1));
            Assert.AreEqual(-1.5, OwnMath.round(-1.53, 1));
            Assert.AreEqual(-1.6, OwnMath.round(-1.58, 1));
            Assert.AreEqual(6, OwnMath.round(6.2, 0));

            //check Round(double a)
            Assert.AreEqual(6, OwnMath.round(6.4));
            Assert.AreEqual(7, OwnMath.round(6.6));
        }