NUnit - Can a test case call another test case? RRS feed

  • Question

  • Hi, I have unit tests denoted by [Test].  Is it possible for one test case to call another test case?  For example, the test case might be "Able to buy milk at the grocery store", which starts off calling the test case "Able to walk to the grocery store".  I also might by using paramterized tests with the "Values" keyword, which may complicate things.  Thanks in advance!
    Thursday, October 11, 2012 12:42 AM


  • Sure, but it's not desirable. Cause unit test are for testing units. So these cases are independent functions and must be tested independently. Otherwise you would get inconclusive results: The test failed, but which part?

    The use of the values attribute does not complicate things. It just helps you to write shorter tests for different sets of input values.

    Thursday, October 11, 2012 6:32 AM