Пример #1
0
        // Tests for Question 4

        public void testQuestion4(OctetAssessment prog)
        {
            Console.WriteLine("Test SmallestProduct");
            Console.WriteLine();
            Console.WriteLine();
            int[] testArray1 = new int[] { 1, 2, 3 };
            int[] testArray2 = new int[] { -1, 0, -2, 3 };
            Console.WriteLine(prog.SmallestProduct(testArray1));
            Console.WriteLine(prog.SmallestProduct(testArray2));
        }
Пример #2
0
        // Tests for question 2
        public void testQuestio2(OctetAssessment prog)
        {
            Console.WriteLine("Test Caclulator");
            Console.WriteLine();
            Console.WriteLine();

            for (int i = 1; i <= 30; i++)
            {
                prog.GetMultiples();
            }
        }
Пример #3
0
        static void Main(string[] args)
        {
            OctetAssessment prog = new OctetAssessment();

            prog.testQuestio2(prog);
            Console.WriteLine();
            Console.WriteLine();
            prog.testQuestion3(prog);
            Console.WriteLine();
            Console.WriteLine();
            prog.testQuestion4(prog);
        }
Пример #4
0
        // Tests for question 3
        // Reading from file feature has not been implemneted yet

        public void testQuestion3(OctetAssessment prog)
        {
            Console.WriteLine("Test Caclulator");
            Console.WriteLine();
            Console.WriteLine();

            // Test for valid expressions

            string[] expressions = new string[4];
            expressions[0] = "SUM: 1, 2, 3 ";
            expressions[1] = "MIN: 4, 3, 2, 40 ";
            expressions[2] = "MAX: 8, 2, 1, 51 ";
            expressions[3] = "AVERAGE: 2, 2 ";
            prog.Calculator(expressions);
            // Test for malformed input
        }