public void FindNthRootTest(double number, int degree, double precision, double expected)
        {
            double actual = MathNumberOperations.FindNthRoot(number, degree, precision);

            if (Math.Abs(actual - expected) > precision)
            {
                Assert.Fail();
            }
        }
Exemplo n.º 2
0
        public void IsOutOfRangeException()
        {
            int numberSource = Convert.ToInt32(TestContext.DataRow["numberSource"]);
            int numberln     = Convert.ToInt32(TestContext.DataRow["numberln"]);
            int firstBit     = Convert.ToInt32(TestContext.DataRow["firstBit"]);
            int secondBit    = Convert.ToInt32(TestContext.DataRow["secondBit"]);

            MathNumberOperations.InsertNumber(numberSource, numberln, firstBit, secondBit);
        }
Exemplo n.º 3
0
        public void InsertNumberTest()
        {
            int numberSource = Convert.ToInt32(TestContext.DataRow["numberSource"]);
            int numberln     = Convert.ToInt32(TestContext.DataRow["numberln"]);
            int firstBit     = Convert.ToInt32(TestContext.DataRow["firstBit"]);
            int secondBit    = Convert.ToInt32(TestContext.DataRow["secondBit"]);
            int expected     = Convert.ToInt32(TestContext.DataRow["ExpectedResult"]);

            int actual = MathNumberOperations.InsertNumber(numberSource, numberln, firstBit, secondBit);

            Assert.AreEqual(expected, actual);
        }
 public void FindNextBiggerNumberTest_number_ArgumentOutOfRangeException(int number)
 => Assert.Throws <ArgumentOutOfRangeException>(() => MathNumberOperations.FindNextBiggerNumber(number));
 public int FindNextBiggerNumberTest(int number)
 => MathNumberOperations.FindNextBiggerNumber(number);
 public void InsertNumberTest_firstBit_secondBit_ArgumentOutOfRangeException(int numberSource, int numberln, int firstBit, int secondBit)
 => Assert.Throws <ArgumentOutOfRangeException>(() => MathNumberOperations.InsertNumber(numberSource, numberln, firstBit, secondBit));
 public int InsertNumberTest(int numberSource, int numberln, int firstBit, int secondBit)
 => MathNumberOperations.InsertNumber(numberSource, numberln, firstBit, secondBit);
 public void FindNthRoot_Degree_Precision_ArgumentOutOfRangeException(double number, int degree, double precision, double expected)
 => Assert.Throws <ArgumentOutOfRangeException>(() => MathNumberOperations.FindNthRoot(number, degree, precision));