コード例 #1
0
        public void CanSolveMSUnit()
        {
            Lab1UnitTesting.LynearEquationsSystem les = new Lab1UnitTesting.LynearEquationsSystem();

            double[,] test = new double[3, 4] {
                { 1, 2, 3, 1 }, { 3, 2, 1, 2 }, { 1, 3, 2, 3 }
            };
            les.SetCoefs(test);

            double fin = les.Det();

            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(12.0, fin);
        }
コード例 #2
0
        public void CanFindDeterminant()
        {
            Lab1UnitTesting.LynearEquationsSystem les = new Lab1UnitTesting.LynearEquationsSystem();

            double[,] test = new double[3, 4] {
                { 1, 2, 3, 1 }, { 3, 2, 1, 2 }, { 1, 3, 2, 3 }
            };
            les.SetCoefs(test);

            double fin = les.Det();

            NUnit.Framework.Assert.AreEqual(12.0, fin);
        }
コード例 #3
0
        public void CanSolveAssertCollection()
        {
            Lab1UnitTesting.LynearEquationsSystem les = new Lab1UnitTesting.LynearEquationsSystem();

            double[,] test = new double[3, 4] {
                { 1, 2, 3, 1 }, { 3, 2, 1, 2 }, { 1, 3, 2, 3 }
            };
            les.SetCoefs(test);

            var fin = les.Det().ToString();
            var exp = "12";

            NUnit.Framework.CollectionAssert.AreEqual(exp, fin);
        }