SparkyTestHelpers.Populater 1.3.4

Install-Package SparkyTestHelpers.Populater -Version 1.3.4
dotnet add package SparkyTestHelpers.Populater --version 1.3.4
<PackageReference Include="SparkyTestHelpers.Populater" Version="1.3.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SparkyTestHelpers.Populater --version 1.3.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SparkyTestHelpers.Populater, 1.3.4"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install SparkyTestHelpers.Populater as a Cake Addin
#addin nuget:?package=SparkyTestHelpers.Populater&version=1.3.4

// Install SparkyTestHelpers.Populater as a Cake Tool
#tool nuget:?package=SparkyTestHelpers.Populater&version=1.3.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

see also:


This project provides tools for populating class instance properties for testing purposes, usually with random values:

using SparkyTestHelpers.Population;
    var populater = new Populater();

    var foo = new Foo();
    populater.PopulateWithRandomValues(foo);

    var foo2 = populater.CreateRandom<Foo>();

There's also a GetRandom static method that uses Populater "behind the scenes":

using SparkyTestHelpers.Population;
    var foo = GetRandom.InstanceOf<Foo>();

The project also has a SequentialValueProvider and associated methods that populates class properties with predictable/repeatable values. I hope to use it in the future for "snapshot testing":

using SparkyTestHelpers.Population;
    var populater = new Populater();

    var foo = new Foo();
    populater.Populate(foo, new SequentialValueProvider()); 

    // (SequentialValueProvider is the default provider for the "Populate" method:
    var foo2 = new Foo();
    populater.Populate(foo);

    var foo3 = populater.CreateAndPopulate<Foo>();

NuGet packages (2)

Showing the top 2 NuGet packages that depend on SparkyTestHelpers.Populater:

Package Downloads
SparkyTestHelpers.Mapping

Unit test helpers for asserting public properties on class instances "mapped" from one type to another (via AutoMapper, another tool, or hand-written code) have the correct values.

SparkyTestHelpers.AutoMapper

Additional AutoMapper extension methods for SparkyTestHelpers.Mapping (Unit test helpers for asserting public properties on class instances "mapped" from one type to another have the correct values.) Version 1.x supports .NET Standard 1.5 and .NET Framework 4.5 Version 2.x supports .NET Standard 2.0 and .NET Framework 4.6

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.3.4 1,827 8/14/2019
1.3.3 32,414 7/27/2019
1.3.2 596 4/20/2019
1.3.1 489 2/5/2019
1.3.0 365 2/2/2019
1.2.1 407 1/16/2019
1.2.0 14,154 1/15/2019
1.1.0 497 1/3/2019
1.0.2 452 1/1/2019
1.0.1 396 1/1/2019
1.0.0 352 12/25/2018

v1.3.4 - Added support for GetRandom<T> where T is string or a primitive type.