Side by side
Mockito vs NUnit
Both stand on unit testing frameworks. Which one you can start free with, which one lets you read the code, and what each costs once you pay.
Pick Mockito for Java unit tests that need stubbing, interaction checks, spies, or injected mocks. Its free MIT-licensed distribution and build-system setup suit development teams. Look elsewhere if your environment cannot use Java 11, or if Android testing cannot meet the Android P requirement.
Visit MockitoNUnit offers a free, MIT-licensed testing framework for several .NET languages, with dependency and repeat controls in version 5. Developers can use its project templates or command-line setup and connect test runs to documented CI workflows.
Visit NUnitThe facts
| Mockito | NUnit | |
|---|---|---|
| Free plan | Yes | Yes |
| Open source | Not published | Not published |
| Runs on | Android, Linux, Self-hosted | Android, API, iPhone, Linux, Mac, Self-hosted, Windows |
| Lowest paid plan | Free or on request | Free or on request |
| Plans published | 1 | 1 |
| Maker | Not published | Not published |
| Website | site.mockito.org | nunit.org |
| On unit testing frameworks | #15 of 32 | #11 of 32 |
Mockito: what it does well
- Mocks interfaces and concrete classes
- Supports ordered and call-count verification
- Spies run real methods while remaining stub-able
- Provides @InjectMocks field injection
- MIT-licensed and free to use
What to know first
- Mockito 5 requires Java 11
- Android mockito-android tests require Android P or newer
- There is no free trial period
- Commercial support and maintenance are available through a Tidelift subscription
NUnit: what it does well
- Free under the MIT license for commercial and noncommercial use
- Supports C#, VB.NET, F#, and C++
- NUnit 5 supports test and fixture dependencies
- Repeat can set a pass percentage from 1 to 100
- Documentation describes CI runs on Azure DevOps and GitHub Actions
What to know first
- No free trial is listed
- NUnit 5 builds target net462, net8.0, and net10.0
Alternatives to Mockito Alternatives to NUnit The whole list

