This post provides a guide to setting up a unit testing project in .NET, including steps for creating the project, adding references, installing necessary NuGet packages, and writing the first unit test. It also introduces the concepts of the Fact Attribute in xUnit and mocking interfaces using NSubstitute.

3m read timeFrom mwaseemzakir.substack.com
Post cover image
Table of contents
How can we set up a unit testing project in .NET?1/ Create a unit test project2/ Add Reference to your test project3/ Install Nuget Package4/ Writing your first unit test5/ Mocking with NSubstitute6/ Better Assertions with FluentAssertions7/ How can we call internal resources in our testing library

Sort: