Skip to content

SimonCropp/NodaTime.Bogus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Add support for NodaTime to Bogus.

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Languages