Ejemplo n.º 1
0
        public void StartFactoring()
        {
            var num     = Input.GetNumberFromUser();                // get # from user
            var factors = FactorFinder.FactFinder(num);             // get factor
            var prime   = PrimeChecker.Prime(factors);              // is prime
            var perfect = PerfectChecker.Perfect(factors, num);     // is perfect

            Output.Results(num, factors, prime, perfect);           // send results to Output.cs
        }
Ejemplo n.º 2
0
        public void FactFinderTest(int test, int[] expected) //  define test method testing # and expected output from all test cases here
        {
            int[] actual = FactorFinder.FactFinder(test);    // method call with test user input

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void PrimeTest(int test, bool expected)
        {
            var actual = PerfectChecker.Perfect(FactorFinder.FactFinder(test), test);

            Assert.AreEqual(expected, actual);
        }