Exemplo n.º 1
0
        /// <summary>
        /// Single test case for "Check_Add" and "check_multiply" function
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="result"></param>
        /// <returns></returns>
        private static AddTestData GetSingleAddData(int x, int y, int result)
        {
            AddTestData singleData = new AddTestData();

            singleData.X = x;
            singleData.Y = y;
            singleData.ExpectedResult = result;
            return(singleData);
        }
Exemplo n.º 2
0
        public void Check_Multiply(AddTestData testData)
        {
            //Arrange
            PrivateObject obj = new PrivateObject(new Demonstration());

            //Act
            var result = obj.Invoke("Multiply", testData.X, testData.Y);

            //Assert
            NUnit.Framework.Assert.AreEqual(testData.ExpectedResult, result, "testing of multiply function has failed for these parameters");
        }
Exemplo n.º 3
0
        public void Check_Add(AddTestData testData)
        {
            //Arrange
            Demonstration obj = new Demonstration();

            //Act
            var result = obj.Add(testData.X, testData.Y);

            //Assert
            NUnit.Framework.Assert.AreEqual(testData.ExpectedResult, result, "testing of ADD function has failed for these parameters");
        }