Search code examples
c#nunitautomated-testsblack-box

Using automated unit test for black box integration test, how bad is that and what is better?


I have an API that can be implemented by various vendors. I can send and receive data and get different return codes with the API.

What I want to do is be able to test the API and in an automated fashion and keep everything as clean as possible. Not really doing unit testing. This would be for use in a testing/QA setting.

What I have done is to create a dummy app in C# and use NUnit to create a suite of tests. So I have all the tests in different classes based on functionality and I can start up NUnit and run my tests and see my results. I like how I can do setup and tear down. This allows me to get the API into a known state. I also like the assertion methods in NUnit.

I don't think this is the intention of NUnit, I would expect most people use NUnit inside of their app to test their own code. My question is, how bad is what I am doing? And what would be better?


Solution

  • This sounds fine, I think. I imagine if you didn't use NUnit, you'd just write something yourself that was a poor copy of NUnit, so stay with it.