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);
        }
        public void TestAdd1()
        {
            var answer = functions.Add1(0);

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

            Assert.AreEqual(4, answer);
            answer = func.Add1(-1);
            Assert.AreEqual(0, answer);
        }
        [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);
        }
示例#5
0
        static void Main(string[] args)
        {
            var functions = new Functions();
            var answer    = functions.Add1(3); // should return 4

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

            var answer = Functions.Add1(3);

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