예제 #1
0
 public Person(Name name, string email, DateTime birth, IEnumerable <Parent> parents, Cpf cpf, HobbyEnumeration hobby, double revenue, string profession, EducationalLevelEnumeration educationalLevel, StatusEnumeration status, bool cloned)
 {
     Id               = Guid.NewGuid();
     Name             = name;
     Email            = email;
     Birth            = birth;
     Parents          = parents;
     Cpf              = cpf;
     Hobby            = hobby;
     Revenue          = revenue;
     Profession       = profession;
     EducationalLevel = educationalLevel;
     Status           = status;
     Cloned           = cloned;
 }
예제 #2
0
 public static Faker <Domain.Entities.Person> Get(StatusEnumeration status = null)
 {
     return(new Faker <Domain.Entities.Person>().CustomInstantiator(f => new Domain.Entities.Person(f.Random.Guid(),
                                                                                                    new Name(f.Person.FirstName, f.Person.LastName),
                                                                                                    f.Person.Email,
                                                                                                    f.Date.Past(),
                                                                                                    ParentFaker.Get().Generate(2),
                                                                                                    new Cpf(f.Person.Cpf(), f.Date.Future(), f.Date.Past()),
                                                                                                    f.PickRandom(HobbyEnumeration.GetAll()),
                                                                                                    f.Random.Double(),
                                                                                                    f.Name.JobTitle(),
                                                                                                    f.PickRandom(EducationalLevelEnumeration.GetAll()),
                                                                                                    status ?? f.PickRandom(StatusEnumeration.GetAll()),
                                                                                                    f.Random.Bool())));
 }