示例#1
0
        public void Start()
        {
            bool running = true;

            while (running)
            {
                ConsoleOutput.DisplayIntroduction();
                int number = ConsoleInput.GetUserInput();
                ConsoleOutput.DisplayResult(number, Factorize.Factor(number), Factorize.IsPerfect(number),
                                            Factorize.IsPrime(number));
                running = ConsoleInput.GetUserStringInput();
                if (!running)
                {
                    ConsoleOutput.DisplayClosing();
                }
            }
        }
        public void IsPerfectTests(int x, bool expected)
        {
            bool actual = Factorize.IsPerfect(x);

            Assert.AreEqual(expected, actual);
        }