Пример #1
0
        public void FindKAndB(double x1, double y1, double x2, double y2, double expectedK, double expectedB)
        {
            double actualK = VariablesMath.SolveIndexK(x1, y1, x2, y2);
            double actualB = VariablesMath.SolveIndexB(x1, y1, x2, y2);

            Assert.AreEqual(expectedK, actualK);
            Assert.AreEqual(expectedB, actualB);
        }
Пример #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Please enter A =");
            double a = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Please enter B =");
            double b = Convert.ToInt32(Console.ReadLine());
            double x = VariablesMath.SimpleFraction(a, b);

            Console.WriteLine("X equal " + x);
        }
Пример #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Please enter A =");
            double a = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Please enter B =");
            double b  = Convert.ToInt32(Console.ReadLine());
            double x  = VariablesMath.SimpleDivision(a, b);
            double x1 = VariablesMath.FindRemainder(a, b);

            Console.WriteLine("Result: " + x + " Remaider: " + x1);
        }
Пример #4
0
 public void FindXNegative(double a, double b, double c)
 {
     try
     {
         VariablesMath.FindX(a, b, c);
     }
     catch
     {
         Assert.Pass();
     }
     Assert.Fail();
 }
Пример #5
0
 public void SimpleDivisionNegative(double a, double b)
 {
     try
     {
         VariablesMath.SimpleDivision(a, b);
     }
     catch
     {
         Assert.Pass();
     }
     Assert.Fail();
 }
Пример #6
0
 public void FindKAndBNegative(double x1, double y1, double x2, double y2)
 {
     try
     {
         VariablesMath.SolveIndexK(x1, y1, x2, y2);
         VariablesMath.SolveIndexB(x1, y1, x2, y2);
     }
     catch
     {
         Assert.Pass();
     }
     Assert.Fail();
 }
Пример #7
0
        static void Main(string[] args)
        {
            Console.WriteLine("Please enter A =");
            double a = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Please enter B =");
            double b = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Please enter C =");
            double c = Convert.ToInt32(Console.ReadLine());
            double x = VariablesMath.FindX(a, b, c);

            Console.WriteLine("X equal " + x);
        }
Пример #8
0
        static void Main(string[] args)
        {
            double x1, y1, x2, y2;

            Console.WriteLine("Enter x1:");
            x1 = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Enter y1:");
            y1 = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Enter x2:");
            x2 = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Enter y2:");
            y2 = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("A (" + x1 + "," + y1 + ")");
            Console.WriteLine("B (" + x2 + "," + y2 + ")");
            double k = VariablesMath.SolveIndexK(x1, y1, x2, y2);
            double b = VariablesMath.SolveIndexB(x1, y1, x2, y2);

            Console.Write("Stright line equation: y=");
            Console.Write(k + "*x + " + b);
        }
Пример #9
0
 public void FindX(double a, double b, double c, double expected)
 {
     double actual = VariablesMath.FindX(a, b, c);
 }
Пример #10
0
            public void RemainderOfTheDivision(double a, double b, double expected)
            {
                double actual = VariablesMath.FindRemainder(a, b);

                Assert.AreEqual(expected, actual);
            }
Пример #11
0
            public void SimpleDivision(double a, double b, double expected)
            {
                double actual = VariablesMath.SimpleDivision(a, b);

                Assert.AreEqual(expected, actual);
            }