コード例 #1
0
        public void AddTest(int a, int b, int c, int expected)
        {
            Homework_1 hw1    = new Homework_1();
            int        actual = hw1.Add(a, b, c);

            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void CalcMaxPlusThreeTest(int a, int b, int c, int expected)
        {
            Homework_1 hw1    = new Homework_1();
            int        actual = hw1.CalcMaxPlusThree(a, b, c);

            Assert.AreEqual(expected, actual);
        }
コード例 #3
0
        public void CalcRootsTest(double a, double b, double c, double[] expected)
        {
            Homework_1 hw1 = new Homework_1();

            double[] actual = hw1.CalcRoots(a, b, c);
            Assert.AreEqual(expected, actual);
        }
コード例 #4
0
        public void CalcStraightLineEquationTest(float x1, float y1, float x2, float y2, float[] expected)
        {
            Homework_1 hw1 = new Homework_1();

            float[] actual = hw1.CalcStraightLineEquation(x1, y1, x2, y2);
            Assert.AreEqual(expected, actual);
        }
コード例 #5
0
        public void CalcMultDigitsInNumberTest(int x, int multRes, int[] expected)
        {
            Homework_1 hw1 = new Homework_1();

            int[] actual = hw1.CalcMultDigitsInNumber(x, multRes);
            Assert.AreEqual(expected, actual);
        }
コード例 #6
0
        public void CalcDiscriminantTest(double a, double b, double c, double expected)
        {
            Homework_1 hw1 = new Homework_1();

            double actual = hw1.CalcDiscriminant(a, b, c);

            Assert.AreEqual(expected, actual);
        }
コード例 #7
0
        public void CalcHypotenuseTest(double cathet_1, double cathet_2, double expected)
        {
            Homework_1 hw1 = new Homework_1();

            double actual = hw1.CalcHypotenuse(cathet_1, cathet_2);

            Assert.AreEqual(expected, actual);
        }
コード例 #8
0
        public void CalcFactorialTest(int n, int expected)
        {
            Homework_1 hw1 = new Homework_1();

            int actual = hw1.CalcFactorial(n);

            Assert.AreEqual(expected, actual);
        }
コード例 #9
0
        public void RightSideOfEquationTest(int n, int expected)
        {
            Homework_1 hw1 = new Homework_1();

            int actual = hw1.RightSideOfEquation(n);

            Assert.AreEqual(expected, actual);
        }
コード例 #10
0
        public void SumNaturalNumbersTest(int n, int expected)
        {
            Homework_1 hw1 = new Homework_1();

            int actual = hw1.SumNaturalNumbers(n);

            Assert.AreEqual(expected, actual);
        }
コード例 #11
0
        public void CalcFunctionValuesTest(double x, double expected)
        {
            Homework_1 hw1 = new Homework_1();

            double actual = hw1.CalcFunctionValues(x);

            Assert.AreEqual(expected, actual);
        }
コード例 #12
0
        public void IsInCircleTest(double x, double y, double r, bool expected)
        {
            Homework_1 hw1 = new Homework_1();

            bool actual = hw1.IsInToCircle(x, y, r);

            Assert.AreEqual(expected, actual);
        }
コード例 #13
0
        public void CalcCreditPaymentsTest(int loanAmount, int years, double percentage, double[] expected)
        {
            Homework_1 hw1 = new Homework_1();

            double[] actual = hw1.CalcCreditPayments(loanAmount, years, percentage);

            Assert.AreEqual(expected, actual);
        }
コード例 #14
0
        public void DefineQuarterTest(int x, int y, int expected)
        {
            Homework_1 hw1 = new Homework_1();

            int actual = hw1.DefineQuarter(x, y);

            Assert.AreEqual(expected, actual);
        }
コード例 #15
0
        public void EquationCheck(int a, int b, int[] expected)
        {
            Homework_1 hw1 = new Homework_1();

            int[] actual = hw1.EquationCheck(a, b);
            Assert.AreEqual(expected, actual);

            a        = 762;
            b        = 62;
            expected = new int[] { 0, 100000 };
            actual   = hw1.EquationCheck(a, b);
            Assert.AreEqual(expected, actual);
        }
コード例 #16
0
        public void CalcEuclideanDivisionTest(int a, int b, int[] expected)
        {
            Homework_1 hw1 = new Homework_1();

            int[] actual = hw1.CalcEuclideanDivision(a, b);
            Assert.AreEqual(expected, actual);

            int c = 70, d = 2;

            expected = new int[] { 35, 0 };
            actual   = hw1.CalcEuclideanDivision(c, d);
            Assert.AreEqual(expected, actual);
        }