Ejemplo n.º 1
0
        public void reversedStringTest()
        {
            Arithmetic_Accessor target = new Arithmetic_Accessor(); // TODO: Initialize to an appropriate value
            string s        = "1234";                               // TODO: Initialize to an appropriate value
            string expected = "4321";                               // TODO: Initialize to an appropriate value
            string actual;

            actual = target.reversedString(s);
            Assert.AreEqual(expected, actual);

            s        = "56"; // TODO: Initialize to an appropriate value
            expected = "65"; // TODO: Initialize to an appropriate value
            actual   = target.reversedString(s);
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        public void computeMultiplicationTest()
        {
            Arithmetic_Accessor target = new Arithmetic_Accessor(); // TODO: Initialize to an appropriate value
            string x        = "888";                                // TODO: Initialize to an appropriate value
            string digit    = "9";                                  // TODO: Initialize to an appropriate value
            int    bNum     = 10;                                   // TODO: Initialize to an appropriate value
            string expected = "7992";                               // TODO: Initialize to an appropriate value
            string actual;

            actual = target.computeMultiplication(x, digit, bNum);
            Assert.AreEqual(expected, actual);

            x        = "ABCDEF";  // TODO: Initialize to an appropriate value
            digit    = "A";       // TODO: Initialize to an appropriate value
            bNum     = 16;        // TODO: Initialize to an appropriate value
            expected = "6B60B56"; // TODO: Initialize to an appropriate value
            actual   = target.computeMultiplication(x, digit, bNum);
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void computeDivisionTest()
        {
            Arithmetic_Accessor target = new Arithmetic_Accessor(); // TODO: Initialize to an appropriate value
            string x        = "4523";                               // TODO: Initialize to an appropriate value
            string digit    = "8";                                  // TODO: Initialize to an appropriate value
            int    bNum     = 10;                                   // TODO: Initialize to an appropriate value
            string expected = "565";                                // TODO: Initialize to an appropriate value
            string actual;

            actual = target.computeDivision(x, digit, bNum);
            Assert.AreEqual(expected, actual);

            x        = "777"; // TODO: Initialize to an appropriate value
            digit    = "4";   // TODO: Initialize to an appropriate value
            bNum     = 8;     // TODO: Initialize to an appropriate value
            expected = "177"; // TODO: Initialize to an appropriate value
            actual   = target.computeDivision(x, digit, bNum);
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 4
0
        public void computeAdditionTest()
        {
            Arithmetic_Accessor target = new Arithmetic_Accessor(); // TODO: Initialize to an appropriate value
            string x        = "5525";                               // TODO: Initialize to an appropriate value
            string digit    = "5";                                  // TODO: Initialize to an appropriate value
            int    bNum     = 6;                                    // TODO: Initialize to an appropriate value
            string expected = "5534";                               // TODO: Initialize to an appropriate value
            string actual;

            actual = target.computeAddition(x, digit, bNum);
            Assert.AreEqual(expected, actual);

            x        = "1011"; // TODO: Initialize to an appropriate value
            digit    = "1";    // TODO: Initialize to an appropriate value
            bNum     = 2;      // TODO: Initialize to an appropriate value
            expected = "1100"; // TODO: Initialize to an appropriate value
            actual   = target.computeAddition(x, digit, bNum);
            Assert.AreEqual(expected, actual);
        }