Skip to content

Category: Testing

NUnit test cases

Testing multiple scenarios through the same function can be a bit of a time sink. Writing out a method for each scenario and just changing the data passed into the function then checking the output against the expected result. Steve Fenton showed me NUnit test cases the other day though which make running multiple permutations of data against a result set a breeze! They have been around a while I think, but I somehow missed that boat. See below for a simple example of how they work. The test above will check multiple combinations of inputs against the expected output…