Esempio n. 1
0
        static void Main()
        {
            _mSolver = new EquationSolver();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            var _mainForm = new Form1();
            _mainForm.StartPosition = FormStartPosition.CenterScreen;
            Application.Run(_mainForm);
        }
Esempio n. 2
0
        public void Init_EquationSolver_should_return_message_about_no_solutions()
        {
            double[,] _matrix = { {-3, 4, 1, 4, -1},
                                {0, 1, 3, 2, -1},
                                {4, 0, -2, -3, 4},
                                {0, 0, 0, 0, -2}};

            EquationSolver _solver = new EquationSolver();
            _solver.Init(_matrix);

            Assert.AreEqual("There are no solutions!", _solver.Solve());
        }
Esempio n. 3
0
        public void Init_EquationSolver_should_return_message_about_infinitely_many_solutions()
        {
            double[,] _matrix = { {-3, 4, 1, 4, -1, 6},
                                {0, 1, 3, 2, -1, 1},
                                {4, 0, -2, -3, 4, -3},
                                {5, 0, -4, 1, 1, 9}};

            EquationSolver _solver = new EquationSolver();
            _solver.Init(_matrix);

            Assert.AreEqual("There are infinitely many solutions!", _solver.Solve());
        }
Esempio n. 4
0
        public void Init_EquationSolver_should_return_message_about_unique_solution()
        {
            double[,] _matrix = { {-3, 4, 1, 4, -1},
                                {0, 1, 3, 2, -1},
                                {4, 0, -2, -3, 4},
                                {1000, 3, 1, -5, -2}};

            EquationSolver _solver = new EquationSolver();
            _solver.Init(_matrix);

            Assert.AreEqual("There is unique solution!", _solver.Solve());
        }
Esempio n. 5
0
        public void Init_EquationSolver_should_return_message_if_matrix_is_empty()
        {
            double[,] _matrix = { { } };

            EquationSolver _solver = new EquationSolver();
            _solver.Init(_matrix);

            Assert.AreEqual("Entering matrix is empty!", _solver.Solve());
        }
Esempio n. 6
0
        public void Init_EquationSolver_should_return_message_about_unique_solution3()
        {
            double[,] _matrix = { {8432, 4825, 4305, 6171},
                                {643, 4399, 7976, 0},
                                {8822, 7372, 9169, 0}};

            EquationSolver _solver = new EquationSolver();
            _solver.Init(_matrix);

            Assert.AreEqual("There is unique solution!", _solver.Solve());
        }
Esempio n. 7
0
        public void Init_EquationSolver_should_return_message_about_unique_solution2()
        {
            double[,] _matrix = { {78, 53, 97, 43, 69, 86},
                                {73, 94, 3, 90, 4, 77},
                                {51, 88, 31, 94, 14, 36},
                                {91, 60, 96, 38, 74, 56},
                                {64, 34, 1, 28, 83, 15}};

            EquationSolver _solver = new EquationSolver();
            _solver.Init(_matrix);

            Assert.AreEqual("There is unique solution!", _solver.Solve());
        }