public void Test_MultiplyMethod()
        {
            BasicMaths basicMaths = new BasicMaths();
            double     result     = basicMaths.Multiply(10, 10);

            Assert.AreEqual(100, result);
        }
        public void Test_AddMethod()
        {
            BasicMaths basicMaths = new BasicMaths();
            double     result     = basicMaths.Add(10, 10);

            Assert.AreEqual(result, 20);
        }
        public void Test_DivideMethod()
        {
            BasicMaths basicMaths = new BasicMaths();
            double     result     = basicMaths.Divide(10, 5);

            Assert.AreEqual(result, 2);
        }
예제 #4
0
        public void TestDivideMethod()
        {
            BasicMaths bm     = new BasicMaths();
            double     result = bm.Divide(10, 2);

            Assert.AreEqual(result, 5);
        }
예제 #5
0
        public void Test_MultiplyMethod()
        {
            BasicMaths bm  = new BasicMaths();
            double     res = bm.Multiply(10, 10);

            Assert.AreEqual(res, 50);
        }
예제 #6
0
        public void Test_AddMethod()
        {
            BasicMaths bm  = new BasicMaths();
            double     res = bm.Add(10, 10);

            Assert.AreEqual(res, 20);
        }
예제 #7
0
        public void Test_AddMethod()
        {
            BasicMaths bm  = new BasicMaths();
            double     res = bm.Add(20.50, 20.50);

            Assert.AreEqual(41, res);
        }
예제 #8
0
        public void TestMultiplyMethod()
        {
            BasicMaths bm     = new BasicMaths();
            double     result = bm.Multiply(10, 3);

            Assert.AreEqual(result, 30);
        }
예제 #9
0
        public void TestSubstractMethod()
        {
            BasicMaths bm     = new BasicMaths();
            double     result = bm.Substract(10, 3);

            Assert.AreEqual(result, 7);
        }
        public void Test_SubstractMethod()
        {
            BasicMaths basicMaths = new BasicMaths();
            double     result     = basicMaths.Deduct(10, 10);

            Assert.AreEqual(result, 0);
        }
예제 #11
0
        public void TestAddMethod()
        {
            BasicMaths bm     = new BasicMaths();
            double     result = bm.Add(10, 3);

            Assert.AreEqual(result, 13);
        }
예제 #12
0
        public void Test_SubstractMethod()
        {
            BasicMaths bm  = new BasicMaths();
            double     res = bm.Substract(10, 10);

            Assert.AreEqual(res, 0);
        }
예제 #13
0
        public void Test_DivideMethod()
        {
            BasicMaths bm  = new BasicMaths();
            double     res = bm.divide(10, 5);

            Assert.AreEqual(res, 2);
        }
예제 #14
0
        public void DivideTest()
        {
            //Arrange
            BasicMaths div      = new BasicMaths();
            double     expected = 2;
            //Act
            double actual = div.Divide(20, 10);

            //Assert
            Assert.AreEqual(expected, actual);
        }
예제 #15
0
        public void MultiplyTest()
        {
            //Arrange
            BasicMaths mul      = new BasicMaths();
            double     expected = 200;
            //Act
            double actual = mul.Multiply(20, 10);

            //Assert
            Assert.AreEqual(expected, actual);
        }
예제 #16
0
        //Unit test for adding the value
        public void AddTest()
        {
            //Arrange
            BasicMaths addValue = new BasicMaths();
            double     expected = 30;
            //Act
            double actual = addValue.Add(20, 10);

            //Assert
            Assert.AreEqual(expected, actual);
        }
예제 #17
0
        public void SubstractTest()
        {
            //Arrange
            BasicMaths sub      = new BasicMaths();
            double     expected = 10;
            //Act
            double actual = sub.Substract(20, 10);

            //Assert
            Assert.AreEqual(expected, actual);
        }
예제 #18
0
        static void Main(string[] args)
        {
            BasicMaths obj = new BasicMaths();

            obj.Addition(20, 30);
            int a = obj.Add(50, 60);

            Console.WriteLine($"Addition from Return Method is {a}");
            obj.Sum();
            int b = obj.Multiply();

            Console.WriteLine($"Multiplication from Return Method is {b}");
            Console.ReadKey();
        }
예제 #19
0
        static void Main(string[] args)
        {
            BasicMaths   bm = new BasicMaths();
            string       strWriteFilePath = @"WriteLog.txt";
            StreamWriter swWriteFile      = File.CreateText(strWriteFilePath);

            for (int i = 0; i < 1000; i++)
            {
                double res1 = bm.Add(i, 1);
                double res2 = bm.Substract(i, 1);
                double res3 = bm.divide(i, 2);
                double res4 = bm.Multiply(i, 2);
                Console.WriteLine(res1.ToString() + ' ' + res2.ToString() + ' ' + res3.ToString() + ' ' + res4.ToString() + ' ');
                swWriteFile.WriteLine(res1.ToString() + ' ' + res2.ToString() + ' ' + res3.ToString() + ' ' + res4.ToString() + ' '); //写入读取的每行数据
                //Console.WriteLine(res2.ToString() + ' ');
                //Console.WriteLine(res3.ToString() + ' ');
                //Console.WriteLine(res4.ToString() + ' ' + '\n');
                System.Threading.Thread.Sleep(2000);
            }
        }
예제 #20
0
        public void Test_SubstractMethod()
        {
            double r = BasicMaths.Substract(10, 10);

            Assert.AreEqual(r, 0);
        }
예제 #21
0
        public void Test_AddMethod()
        {
            double r = BasicMaths.Add(10, 10);

            Assert.AreEqual(r, 20);
        }
예제 #22
0
        public void Test_MultiplyMethod()
        {
            double r = BasicMaths.Multiply(10, 10);

            Assert.AreEqual(r, 100);
        }
예제 #23
0
        public void Test_DivideMethod()
        {
            double r = BasicMaths.Divide(10, 5);

            Assert.AreEqual(r, 2);
        }