public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();
            var connectionString = config["connectionStrings:livehAPIConnection"];

            var options = new DbContextOptionsBuilder <LiveHAPIContext>()
                          .UseSqlServer(connectionString)
                          .Options;

            _reader  = new ClientLookupReader(new RestClient(_baseUrl));
            _context = new LiveHAPIContext(options);

            _repository = new SubscriberTranslationRepository(_context);
            _subscriberSystemRepository = new SubscriberSystemRepository(_context);
            _service = new SyncLookupService(_reader, _repository);
            _emr     = _subscriberSystemRepository.GetDefault();
        }
예제 #2
0
 public CohortsController(ISubscriberSystemRepository subscriberSystemRepository, IClientService clientService)
 {
     _subscriberSystemRepository = subscriberSystemRepository;
     _clientService    = clientService;
     _subscriberSystem = _subscriberSystemRepository.GetDefault();
 }