Search code examples
unit-testingnunitnsubstitutejustmock

Is it safe to use the set of unit testing frameworks in the same project?


Visual Studio

I use NUnit in my project with unit tests. But I need some tests to write with using JustMock and NSubstitute frameworks. I want to have one project with the tests for each my tested project. I.e. I don't want to have the individual project with tests for each unit framework (NUnit, JustMock and NSubstitute). Will I have the problems (for example, conflicts with their test adapters) if my tests will be in a single project?


Solution

  • NUnit is a testing framework. NSubstitute is a mocking framework. From the name, I suppose JustMock is also a mocking framework. Testing frameworks and mocking frameworks are different things, so they don't generally conflict.

    Between two different mocking frameworks, it's possible but not likely to have conflicts. I think most of them would show up at compile time, in case the framework uses the same names and you are using both namespaces in a file.

    It will be easier to answer, however, if you have some specific concerns.