This library provides helpful items to speed the development of unit tests across all .NET Core project types. We will update this library regularly with helpful base classes/implementations.
Install from NuGet
Install-Package ICG.NetCore.Utilities.UnitTesting
Inside of of your project's Startup.cs within the RegisterServices method add this line of code.
services.UseIcgUnitTestUtilities();
Object | Purpose |
---|---|
AbstractDataServiceTest | Provides an abstract class that will build the proper options for an EF In Memory Database Provider |
AbstractModelTest | Provides an abstract class that contains helpful items for writing unit tests for model objects |
SampleDataGenerator | Provides a utility for generating sample strings, dates, and the like for building unit tests, can be used with DI or standard creation |
XUnitLogger | Provides an implementation of ILogger that writes to xUnit's ITestOutputHelper |
DatabaseFixture | A test fixture with helper methods for setup and verification that allows tests to be run against a SQL database. Uses Respawn to reset the database between test runs |
Detailed information can be found in the XML Comment documentation for the objects, we are working to add to this document as well. |
ICG has a number of other related projects as well