Example #1
0
        public UserRepositoryTests(RepositoryFixture <UserRepository> userRepositoryFixture)
        {
            ContextHelper.DisableAudits();
            _context        = userRepositoryFixture.Context;
            _contextOptions = userRepositoryFixture.ContextOptions;

            var optionsMonitor = new Mock <IOptionsMonitor <AdOptions> >();

            optionsMonitor.Setup(om => om.CurrentValue).Returns(new AdOptions {
                ReadOnlyUserGroup = "ReadOnly"
            });
            _userRepo = new UserRepository(_context, optionsMonitor.Object);

            var phec = new PHEC {
                Code = "E45000001", Name = "London"
            };

            _tbService1 = new TBService {
                Code = "TBS0001", IsLegacy = false, PHECCode = "E45000001"
            };
            _tbService2 = new TBService {
                Code = "TBS0002", IsLegacy = false, PHECCode = "E45000001"
            };
            _context.PHEC.Add(phec);
            _context.TbService.AddRange(_tbService1, _tbService2);
            _context.SaveChanges();
        }
 public DataQualityRepositoryTests(RepositoryFixture <DataQualityRepository> dataQualityRepositoryFixture)
 {
     ContextHelper.DisableAudits();
     _context = dataQualityRepositoryFixture.Context;
 }
Example #3
0
 public AlertRepositoryTests(RepositoryFixture <AlertRepository> alertRepositoryFixture)
 {
     ContextHelper.DisableAudits();
     _context   = alertRepositoryFixture.Context;
     _alertRepo = new AlertRepository(_context);
 }