DEV Community

Cover image for SparkyTestHelpers
Brian Schroer
Brian Schroer

Posted on • Edited on

SparkyTestHelpers

The SparkyTestHelpers are a set of .NET unit test helper tools I've created and published via NuGet. My hope is that they make unit testing easier.

Easier tests = More tests = Better code.

The tools are "test framework agnostic" - You can use them with MSTest, NUnit, XUnit, etc.

SparkyTestHelpers: Exceptions

Helpers for asserting that expected exceptions are thrown (and that unexpected exceptions aren't!)
nuget | details

SparkyTestHelpers: Scenarios

Provides the ability to execute the same test code for multiple test cases and, after all test cases have been executed, fail the unit test if any of the test cases failed.
nuget | details

SparkyTestHelpers: AppSettings

Unit test helpers for "appSettings" values in XML .config files.
nuget | details

SparkyTestHelpers: Moq

Unit test syntax helpers for the Moq mocking framework.
nuget | details

SparkyTestHelpers: Mapping/AutoMapper

Helpers for testing that properties were successfully "mapped" from one type to another, either via AutoMapper or another automatic mapping framework, or by hand-written "destination.X = source.X;" code.
nuget | details

SparkyTestHelpers: Populater

This package provides tools for auto-populating class instance properties for testing purposes, usually with random values.
nuget | details

SparkyTestHelpers: XML

Helpers to perform .config file XML transformations, and to test the resulting transformed XML (or actually any XML, whether it's .config format or not).
nuget | details

SparkyTestHelpers: DataAnnotations

Helper classes to enable a fluent syntax for unit testing of .NET models and entities that use System.ComponentModel.DataAnnotations ValidationAttributes.
nuget | details

SparkyTestHelpers: AspNetMvc

These NuGet packages (one for the “classic” ASP.NET MVC Framework and one for ASP.NET Core MVC) contain helpers for testing that MVC controller actions return expected results, and for testing routing rules.
nuget | details

How to test C# private methods / SparkyTestHelpers.NonPublic

You shouldn't - But if you do, here's how
nuget | details

Top comments (0)