Exemple #1
0
        public static ICustomer[] GetCompanyies(int?number = 3)
        {
            var faker = new Faker <Organization>();

            faker.RuleFor(u => u.Id, f => Guid.NewGuid());
            faker.RuleFor(u => u.Name, f => f.Company.CompanyName());

            faker.RuleFor(u => u.Type, Statics.OrgCustomerType);
            faker.RuleFor(x => x.Addresses, ServiceMocks.GetAddresses());
            faker.RuleFor(x => x.PhoneNumbers, ServiceMocks.GetPhoneNumbers());

            faker.RuleFor(u => u.Identifier,
                          (f) => new CodeValue(Statics.NORWEGIAN_ORG_NUMBER, f.Random.String2(9, "0123456789")));
            return(faker.Generate(number.GetValueOrDefault(3)).Cast <ICustomer>().ToArray());
        }
Exemple #2
0
        public static List <ICustomer> GetPersons(int?number = 3)
        {
            var faker = new Faker <PrivatePerson>();

            faker.RuleFor(u => u.Id, f => Guid.NewGuid());
            faker.RuleFor(u => u.FirstName, f => f.Person.FirstName);
            faker.RuleFor(u => u.LastName, f => f.Person.LastName);
            faker.RuleFor(u => u.Type, f => Statics.PrivatePersonCustomerType);
            faker.RuleFor(x => x.Addresses, ServiceMocks.GetAddresses());
            faker.RuleFor(x => x.PhoneNumbers, ServiceMocks.GetPhoneNumbers());
            faker.RuleFor(u => u.PersonId, f => Guid.NewGuid());
            faker.RuleFor(u => u.Identifier, f =>
            {
                return(new CodeValue(Statics.NORWEGIAN_BIRTHDAY_NUMBER, string.Format("{0}{1}", f.Date.Past().ToString("ddmmdd"), f.Random.String2(5, "0123456789"))));
            });



            return(faker.Generate(number.GetValueOrDefault(3)).Cast <ICustomer>().ToList());
        }