Created
April 27, 2018 09:58
-
-
Save pykong/66ac7c14174b854a46cc824ed64cbab0 to your computer and use it in GitHub Desktop.
https://github.com/diogolmenezes/Faker PM> Install-Package FakerTest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class User | |
{ | |
public string Name { get; set; } | |
public string Email { get; set; } | |
public int Age { get; set; } | |
public DateTime CreatedAt { get; set; } | |
} | |
// creating one fake user | |
var user = new Faker<User>().Create(); | |
// creating 10 fake users | |
var user = new Faker<User>().CreateMany(10); | |
// creating 10 users with real names and real mail adresses | |
var user = new Faker<User>().CreateMany(10, x=> { x.Name = new NameGenerator().Get(); x.Email = new EmailGenerator().Get() }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment