Ejemplo n.º 1
0
        public TestManagerTests()
        {
            var dataDomainProfile = new DataDomainProfile();
            var configuration     = new MapperConfiguration(cfg => cfg.AddProfile(dataDomainProfile));

            _mapper = new Mapper(configuration);

            _dataTests = new Faker <DataTest>()
                         .RuleFor(x => x.Name, y => y.Internet.Random.AlphaNumeric(_generateTestNameLength))
                         .RuleFor(x => x.Minutes, y => y.Random.Number(_generateTestMinMinutes, _generateTestMaxMinutes))
                         .RuleFor(x => x.IsDeleted, y => y.Random.Bool());

            _dataUsers = new Faker <DataUser>()
                         .RuleFor(x => x.Email, y => y.Internet.Email())
                         .RuleFor(x => x.PasswordHash, y => CryptographyHelper.GetSha256Hash(y.Internet.Password()))
                         .RuleFor(x => x.Role, y => y.PickRandom <UserRoles>())
                         .RuleFor(x => x.IsDeleted, y => y.Random.Bool())
                         .RuleFor(x => x.ConfirmationToken, y => Guid.NewGuid())
                         .RuleFor(x => x.IsConfirmed, y => y.Random.Bool());

            _dataUserTests = new Faker <DataUserTest>()
                             .RuleFor(x => x.IsDeleted, y => y.Random.Bool())
                             .RuleFor(x => x.StartTime, y => new DateTime())
                             .RuleFor(x => x.Points, y => y.Random.Number(1, 20))
                             .RuleFor(x => x.Status, y => y.PickRandom <TestStatus>());
        }
Ejemplo n.º 2
0
        public TestManagerTests()
        {
            var dataDomainProfile = new DataDomainProfile();
            var configuration     = new MapperConfiguration(cfg => cfg.AddProfile(dataDomainProfile));

            _mapper = new Mapper(configuration);

            _dataUsers = new Faker <DataUser>()
                         .RuleFor(x => x.Email, y => y.Internet.Email())
                         .RuleFor(x => x.PasswordHash, y => CryptographyHelper.GetSha256Hash(y.Internet.Password()))
                         .RuleFor(x => x.Role, y => y.PickRandom <UserRoles>())
                         .RuleFor(x => x.IsDeleted, y => y.Random.Bool())
                         .RuleFor(x => x.ConfirmationToken, y => Guid.NewGuid())
                         .RuleFor(x => x.IsConfirmed, y => y.Random.Bool());
        }