Tags

NUnit Assert Examples - How to Use?

NUnit Assert class is used to determine whether a particular test method gives expected result or not. In a test method, we write code the check the business object behavior. That business object returns a result. In Assert method we match the actual result with our expected result. If result comes according to our expected result then our test case is passed else failed. Constraint Mo...

Continue Reading

NUnit TestCase - Array and Execution Order - NUnit Tutorial

In this C# NUnit tutorial, we'll learn about how to pass same type of objects array into test method and how to control the execution order of test methods. NUnit TestCase Array Below is the example of passing array to a test method. [TestCase(new int[] { 2, 4, 6 })] public void When_AllNumberAreEven_Expects_AreAllNumbersEvenAsTrue(int[] numbers) { Number number = new Number...

Continue Reading

NUnit TestCase C# Tutorial

In our last tutorial, we learned about NUNit TestFixture attribute. In this tutorial, we learn about NUnit TestCase attribute and its usage. TestCase attribute is used for two purposes. It marks a method to Test Method. Pass arguments / parameters to Test Method. Test Method When we assign TestCase attribute to any method that lets NUnit test runner to discover this method ...

Continue Reading