public void Test1()                 //Assert is a class of methods
        {
            var answer = functions.Add1(0); //Adds actual answer

            Assert.AreEqual(1, answer);     //(expected answer, actual answer)
            answer = functions.Add1(-1);
            Assert.AreEqual(0, answer);
        }
Exemplo n.º 2
0
        public void TestAdd1()
        {
            var answer = functions.Add1(0);

            Assert.AreEqual(1, answer);
            answer = functions.Add1(-1);
            Assert.AreEqual(0, answer);
        }
Exemplo n.º 3
0
        public void TestAdd1()
        {
            var answer = func.Add1(3); // return 4

            Assert.AreEqual(4, answer);
            answer = func.Add1(-1);
            Assert.AreEqual(0, answer);
        }
Exemplo n.º 4
0
        [TestMethod]        //must have test attribute and only those marked with "test" can be used
        public void Test1() //must be public void and cannot take any parameters
        {
            var answer = functions.Add1(0);

            Assert.AreEqual(1, answer);
            answer = functions.Add1(-1);
            Assert.AreEqual(0, answer);
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            var functions = new Functions();
            var answer    = functions.Add1(3); // should return 4

            Console.WriteLine($"Answer is {answer}");
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            var Functions = new Functions();

            var answer = Functions.Add1(3);

            Console.WriteLine($"Answer is {answer}");
        }