Skip to content

Latest commit

 

History

History
57 lines (39 loc) · 2.84 KB

readme.md

File metadata and controls

57 lines (39 loc) · 2.84 KB

NodaTime.Bogus

Build status NuGet Status

Add support for NodaTime to Bogus.

See Milestones for release notes.

NuGet package

https://nuget.org/packages/NodaTime.Bogus/

Usage

This project extends Faker with .Noda().

var faker = new Faker<Target>()
    .RuleFor(u => u.Property1, (f, _) => f.Noda().Duration())
    .RuleFor(u => u.Property2, (f, _) => f.Noda().Instant.Recent())
    .RuleFor(u => u.Property3, (f, _) => f.Noda().ZonedDateTime.Future());

var target = faker.Generate();
Debug.WriteLine(target.Property1);
Debug.WriteLine(target.Property2);
Debug.WriteLine(target.Property3);

snippet source | anchor

There are several top level generators:

There are several nested generators that provide Past, Soon, Future, Between, and Recent semantics:

Icon

Calendar designed by Monster Critic from The Noun Project.