Click here to Skip to main content
15,916,398 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
    public class Program
        static void Main(string[] args)
            Console.WriteLine("enter a");
            int a = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("enter b");
            int b = Convert.ToInt32(Console.ReadLine());
            Class1 obj = new Class1();
            int c = 0;
            obj.Add(a, b, out c);
        public class Class1

            public void Add(int a, int b, out int c)
                c = a + b;
Updated 28-Jan-16 15:38pm
Sergey Alexandrovich Kryukov 28-Jan-16 19:33pm    
What do you mean "how"? By writing NUnit tests and using them for testing. What's wrong with reading original NUnit documentation? Any particular problems?
Right now, you have nothing to test. What would be your testing criteria? :-)

1 solution

You can write NUnit test method(s) in exact same way as it is usually done with NUnit. The basic idea is to create a class(es) (or use existing class(es)) marked with the attribute [TestFixture] and create some test method(s) marked with the attribute [Test] and then use the utility to perform the tests: NUnit — QuickStart[^].

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900