Exemple #1
0
        public void RoundToNextNumber()
        {
            decimal valueToTest = 4.99M;
            string  expected    = "5";
            string  result      = DecimalToFractions.Fractional(Convert.ToDecimal(valueToTest));

            Assert.AreEqual(expected, result);
        }
Exemple #2
0
        public void ZeroTest()
        {
            decimal valueToTest = 0;
            string  expected    = "0";
            string  result      = DecimalToFractions.Fractional(Convert.ToDecimal(valueToTest));

            Assert.AreEqual(expected, result);
        }
Exemple #3
0
        public void RandomDecimalTest()
        {
            decimal valueToTest = 4.78M;
            string  expected    = "4 3/4";
            string  result      = DecimalToFractions.Fractional(Convert.ToDecimal(valueToTest));

            Assert.AreEqual(expected, result);
        }
Exemple #4
0
        public void WholeNumberTest()
        {
            decimal valueToTest = 4;
            string  expected    = "4";
            string  result      = DecimalToFractions.Fractional(Convert.ToDecimal(valueToTest));

            Assert.AreEqual(expected, result);
        }