Skip to content

Instantly share code, notes, and snippets.

@brendan-nobadthing
Created June 2, 2023 01:23
Show Gist options
  • Save brendan-nobadthing/ab6816a44924095c788d8b1698714550 to your computer and use it in GitHub Desktop.
Save brendan-nobadthing/ab6816a44924095c788d8b1698714550 to your computer and use it in GitHub Desktop.
Bogus code to create test users
private IList<User> BuildUsers()
{
var orgFaker = new Faker<User>("en_AU")
.RuleFor(x => x.UserId, f => f.Random.Guid())
.RuleFor(x => x.OrgId, f => f.Random.ListItem(Organisations).OrgId)
.RuleFor(x => x.FirstName, f => f.Name.FirstName())
.RuleFor(x => x.LastName, f => f.Name.LastName())
.RuleFor(x => x.Address, f => f.Address.FullAddress())
.RuleFor(x => x.State, f => f.Address.State())
.RuleFor(x => x.Dob, f => f.Date.PastDateOnly(70, new DateOnly(2010,1,1)));
return orgFaker.Generate(10000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment