예제 #1
0
        public void SolveEquation_PositiveInfinity()
        {
            var input    = new double[] { double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity };
            var shouldBe = new double[] { };
            var reallyIs = StupidMaths.SolveEquaiton(input[0], input[1], input[2]);

            CollectionAssert.AreEquivalent(shouldBe, reallyIs);
        }
예제 #2
0
        public void SolveEquation()
        {
            var input    = new double[] { 0, 0, 0 };
            var shouldBe = new double[] { };
            var reallyIs = StupidMaths.SolveEquaiton(input[0], input[1], input[2]);

            CollectionAssert.AreEquivalent(shouldBe, reallyIs);
        }
예제 #3
0
        public void SolveEquation_TwoDifferentRoots()
        {
            var input    = new double[] { -1, -2, 15 };
            var shouldBe = new double[] { 3, -5 };
            var reallyIs = StupidMaths.SolveEquaiton(input[0], input[1], input[2]);

            CollectionAssert.AreEquivalent(shouldBe, reallyIs);
        }
예제 #4
0
        public void SolveEquation_TwoOppositeRoots()
        {
            var input    = new double[] { 1, 0, -1 };
            var shouldBe = new double[] { 1, -1 };
            var reallyIs = StupidMaths.SolveEquaiton(input[0], input[1], input[2]);

            CollectionAssert.AreEquivalent(shouldBe, reallyIs);
        }
예제 #5
0
        public void SolveEquation_OneRealRoot()
        {
            var input    = new double[] { 1, -Math.Sqrt(2) * 2, 2 };
            var shouldBe = new double[] { Math.Sqrt(2) };
            var reallyIs = StupidMaths.SolveEquaiton(input[0], input[1], input[2]);

            CollectionAssert.AreEquivalent(shouldBe, reallyIs);
        }
예제 #6
0
        public void SolveEquation_OneNegativeRoot()
        {
            var input    = new double[] { 1, 2, 1 };
            var shouldBe = new double[] { -1 };
            var reallyIs = StupidMaths.SolveEquaiton(input[0], input[1], input[2]);

            CollectionAssert.AreEquivalent(shouldBe, reallyIs);
        }
예제 #7
0
        public void SolveEquation_NoRootsBigNumbers()
        {
            var input    = new double[] { 1000000, 1, 1000000 };
            var shouldBe = new double[] { };
            var reallyIs = StupidMaths.SolveEquaiton(input[0], input[1], input[2]);

            CollectionAssert.AreEquivalent(shouldBe, reallyIs);
        }