NuGet Package Alternatives
Last Updated: 2025-04-22
As part of ongoing efforts to reduce dependency risks and licensing surprises in our codebases, here’s a quick review of popular testing libraries and recent developments, along with recommended alternatives where relevant.
| Package | Function | Recent Major Issue |
Issue Resolved? |
Alternative #1 |
Alternative #2 |
|---|---|---|---|---|---|
Moq799.7M downloads |
Mocking library | See details | ✅ Yes | NSubstitute168.2M downloads |
FakeItEasy53.7M downloads |
FluentAssertions494M downloads |
Readable test assertions | See details | ❌ No | Shouldly66.4M downloads |
Use built-in Xunit.Assert methods |
Automapper660.5M downloads |
Object-object mapping | See details | ❌ No | Mapster38.9M downloads |
Write mapping logic natively |
MediatR244.8M downloads |
In-process messaging (CQRS) | See details | ❌ No | Multiple new alternatives |
Wait until commercial license is required |
Bogus |
Fake test data generator | No known issues | - | – | – |
coverlet |
Code coverage tool | No known issues | - | – | – |
FluentResults |
Result pattern for C# | No known issues | - | – | – |
xUnit |
Testing framework | No known issues | - | – | – |
Issue Details
Moq
- Date: August 2023
- Issue: Moq version 4.20.0 introduced SponsorLink, a closed-source dependency that extracts the developer’s email from the local Git configuration, hashed it, and transmitted it to a remote server.
- Resolution: Moq version 4.20.2 removed SponsorLink from the package. However, the maintainer has expressed an intention to reintroduce SponsorLink in a future version.
- Recommended Action: Upgrade Moq to version 4.20.2 or later for existing projects. Switch to using NSubstitute for new projects.
FluentAssertions
- Date: January 2025
- Issue: FluentAssertions version 8.0 introduced a commercial licensing model, requiring companies to obtain a paid license per developer per year for usage in commercial products.
- Resolution: Version 8+ is free for open source and non-commercial use. Version 7 will remain fully open-source indefinitely and receive bugfixes.
- Recommended Action: Keep FluentAssertions to version 7.x for commercial use.
Automapper & MediatR
- Date: April 2025
- Issue: Maintainers have expressed desire to have commercial licenses for both Automapper & MediatR. The nugets will remain free for open source and non-commercial use.
- Resolution: Seek alternatives or wait until the the commercial license have been implemented.
- Recommended Action: Continue using MediatR for now. Map objects natively rather than use Automapper.