Example #1
0
        public UserAccountRepositoryTests()
        {
            //this.sut = this.ServiceProvider.GetService<IUserAccountRepository>();
            this.sut = this.ServiceProvider.GetRequiredService <IGenericRepository <UserAccount> >();
            this.ServiceProvider.GetRequiredService <UserAccountsDbContext>().Database.Migrate();
            var domains = new[] { "East", "West" };

            this.entityFaker = new Faker <UserAccount>() //https://github.com/bchavez/Bogus
                               .RuleFor(u => u.Email, (f, u) => f.Internet.Email())
                               .RuleFor(u => u.LastVisitDate, (f, u) => DateTime.UtcNow.AddDays(-1))
                               .RuleFor(u => u.RegisterDate, (f, u) => DateTime.UtcNow.AddDays(-14))
                               .RuleFor(u => u.TenantId, (f, u) => this.tenantId)
                               .RuleFor(u => u.AdAccount, (f, u) => AdAccount.For(f.PickRandom(new[] { "East", "West" }) + $"\\{f.System.Random.AlphaNumeric(5)}"))
                               //.RuleFor(u => u.Status, (f, u) => f.PickRandom(new[] { UserAccountStatus.Active, UserAccountStatus.Inactive }))
                               .RuleFor(u => u.Status, (f, u) => f.PickRandom(new[] { UserAccountStatus.For("Active"), UserAccountStatus.For("Inactive") }))
                               .RuleFor(u => u.VisitCount, (f, u) => 1);
        }