Shouldly
Verify
Our great sponsors
Shouldly | Verify | |
---|---|---|
4 | 5 | |
1,970 | 2,324 | |
0.5% | 2.3% | |
6.8 | 9.7 | |
3 days ago | 2 days ago | |
C# | C# | |
GNU General Public License v3.0 or later | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Shouldly
-
NUnit vs XUnit for .net6+ microservices
On a side note, something I would highly recommend NOT doing is using the built in assertion types for any of the test adapters. Without a doubt the hardest part of switching unit test frameworks is having to fix all your assertions which is why we use 3rd party assertions. The built-in assertions also tend to not be very feature rich and don't have the most helpful messages. We personally use FluentAssertions, but there are other options such as Shoudly or Should. I highly recommend picking one of them over the built in assertions. You will thank yourself later :)
-
I need a C# crash course for experienced developers
Shouldly - More "fluent" way of writing assertions that I tend to like more personally. Example:
-
What's your go-to unit testing tool?
I use NUnit and Shoudly.
-
Adelaide United's Josh Cavallo has openly come out as gay.
Robbie Rogers came out in the MLS like a decade ago
Verify
-
Do you guys mock everything in your Unit Tests?
Bogus - For creating fake data Verify - Snapshot testing for .NET MELT - For testing ILogger usage Stryker - Mutation Testing for .NET TestContainers - run docker programmatically in integration tests
-
organizing testing projects
Are you familiar with "snapshot testing" tools such as Verify that store expected output in files. It's still unit testing.
-
Add persisted parameters to CLI applications in .NET
We can use Verify to perform snapshot testing and check for the correct output of the program. In order to make things easier and simplify working with process output capturing and invocation, I used CliWrap.
-
In EF Core every foreach is a potential runtime error that can't be properly fixed
You will have to write extra code to set up a code base to get it started (there's always a large initial cost in getting things set up, and you'll be writing code that helps get the state of your application setup), but I can assure you that our team paid the initial tax and the only reason our tests change now is because of requirements changes (and maybe sometimes because the testing tools we use like Verify have some breaking changes in behavior when we upgrade). Otherwise, it helps us identify issues in our code, particularly when we do library upgrades or change to a different library. Again, our tests do not change when we completely reimplement anything, just when the external contract changes. We just get to refactor/reimplement and have confidence that the old behavior stays the same. And then you get to hook up a benchmark to your tests and, if your reason for refactoring was performance reasons, you can show that it was effective.
-
Perfect Replayability
I assume this means you can take something like this, combine it with Snapshot/Approval testing (link to a library I have used), and then you have some quick-to-generate tests that help guard against regressions (even visual ones) by say:
What are some alternatives?
Fluent Assertions - A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Targets .NET Framework 4.7, as well as .NET Core 2.1, .NET Core 3.0, .NET 6, .NET Standard 2.0 and 2.1. Supports the unit test frameworks MSTest2, NUnit3, XUnit2, MSpec, and NSpec3.
snapshooter - Snapshooter is a snapshot testing tool for .NET Core and .NET Framework
xUnit - xUnit.net is a free, open source, community-focused unit testing tool for .NET.
NUnit - NUnit Framework
should - Should Assertion Library
Bogus - :card_index: A simple fake data generator for C#, F#, and VB.NET. Based on and ported from the famed faker.js.
Moq - Repo for managing Moq 4.x [Moved to: https://github.com/moq/moq]
MSTest - MSTest framework and adapter
NFluent - Smooth your .NET TDD experience with NFluent! NFluent is an ergonomic assertion library which aims to fluent your .NET TDD experience (based on simple Check.That() assertion statements). NFluent aims your tests to be fluent to write (with a super-duper-happy 'dot' auto-completion experience), fluent to read (i.e. as close as possible to plain English expression), but also fluent to troubleshoot, in a less-error-prone way comparing to the classical .NET test frameworks. NFluent is also directly inspired by the awesome Java FEST Fluent assertion/reflection library (http://fest.easytesting.org/)
SpecFlow - #1 .NET BDD Framework. SpecFlow automates your testing & works with your existing code. Find Bugs before they happen. Behavior Driven Development helps developers, testers, and business representatives to get a better understanding of their collaboration