Exemplo n.º 1
0
        public void TestSolve()
        {
            //
            var expected = 8;
            var utility  = new SolverUtility();

            //
            var actual = Math.Round(utility.Solve(x => Math.Pow(x, 2), 64, 6), 6);

            //
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 2
0
        public string TestForException()
        {
            //
            var utility = new SolverUtility();

            //
            TestDelegate testDelegate = () => utility.Solve(x => 1, 2, 1);

            //
            var ex = Assert.Throws <Exception>(testDelegate);

            return(ex.Message);
        }