예제 #1
0
        public void RootsCalculator_HasNoRoots_ReturnsNoRoot()
        {
            // Assign
            var quadraticEqn = new QuadraticEqn(1, 2, 4);

            // Act
            List <double> result;

            result = quadraticEqn.RootsCalculator();

            // Assert
            Assert.That(result[0] == 0);
        }
예제 #2
0
        public void RootsCalculator_HasTwoRoots_ReturnsTwoRoots()
        {
            // Assign
            var quadraticEqn = new QuadraticEqn(1, 3, 2);


            // Act
            List <double> result;

            result = quadraticEqn.RootsCalculator();

            // Assert
            Assert.That(result[0] == -1);
            Assert.That(result[1] == -2);
        }