Пример #1
0
        public void TestSolveShouldThrowWrongDALOnLoad()
        {
            BL logic = new BL();
            mock.coefs = new Double[3] { 1, 4, 20 };

            FieldInfo fi = logic.GetType().GetField("_dal",
                BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
            fi.SetValue(logic, new DALError());

            logic.Solve();
        }
Пример #2
0
        public void TestSolveHasSameRoots()
        {
            BL logic = new BL();
            mock.coefs = new Double[3] { 1, 4, 4 };

            FieldInfo fi = logic.GetType().GetField("_dal",
                BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
            fi.SetValue(logic, mock);

            logic.Solve();
            Assert.AreEqual("-2;-2;True", mock.results);
        }