Esempio n. 1
0
        public void Matrix_ExpextToBeCorrectOnSize6()
        {
            int          size   = 6;
            MatrixEngine matrix = new MatrixEngine(testingConsole, size);

            matrix.Run();
            matrix.PrintMatrix();
            string result   = testingConsole.GetWriteText();
            string expected = "  1 16 17 18 19 20\n 15  2 27 28 29 21\n 14 31  3 26 30 22\n 13 36 32  4 25 23\n 12 35 34 33  5 24\n 11 10  9  8  7  6";

            Assert.AreEqual(expected, result, "Expected matrix 6x6");
        }
Esempio n. 2
0
        public void Matrix_ExpextToBeCorrectOnSize3()
        {
            int          size   = 3;
            MatrixEngine matrix = new MatrixEngine(testingConsole, size);

            matrix.Run();
            matrix.PrintMatrix();
            string result   = testingConsole.GetWriteText();
            string expected = "  1  7  8\n  6  2  9\n  5  4  3";

            Assert.AreEqual(expected, result, "Expected matrix 3x3");
        }
Esempio n. 3
0
        public static void Main(string[] args)
        {
            /*MatrixConsole.WriteLine("Enter a positive number between 1 and 100: ");
             * string input = MatrixConsole.ReadLine();
             * int n = 0;
             * while (!int.TryParse(input, out n) || n < 0 || n > 100)
             * {
             *  MatrixConsole.WriteLine("You haven't entered a correct positive number");
             *  input = MatrixConsole.ReadLine();
             * }*/

            MatrixEngine engine = MatrixEngine.Instance;

            engine.Size = 3;
            engine.Start();
        }
Esempio n. 4
0
 public void MatrixSize_ExpectExceptionIfMatrixSizeIs101()
 {
     MatrixEngine matrix = new MatrixEngine(testingConsole, 101);
 }
Esempio n. 5
0
 public void MatrixSize_ExpectExceptionIfMatrixSizeIsNegative()
 {
     MatrixEngine matrix = new MatrixEngine(testingConsole, -2);
 }