public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();
            var connectionString = config["connectionStrings:livehAPIConnection"];
            //var connectionString = config["connectionStrings:livehAPIConnection"].Replace("#dir#", TestContext.CurrentContext.TestDirectory.HasToEndWith(@"\"));
            var options = new DbContextOptionsBuilder <LiveHAPIContext>()
                          .UseSqlServer(connectionString)
                          .Options;

            _context = new LiveHAPIContext(options);

            _clientPretestStageRepository = new ClientPretestStageRepository(_context);
            _clientEncounterRepository    = new ClientEncounterRepository(_context);
            _subscriberSystemRepository   = new SubscriberSystemRepository(_context);
            _practiceRepository           = new PracticeRepository(_context);
            _clientStageRepository        = new ClientStageRepository(_context);
            _contactsEncounterRepository  = new ContactsEncounterRepository(_context);
            _clientMessageLoader          =
                new FamilyClientMessageLoader(

                    _practiceRepository, _clientStageRepository, new ClientStageRelationshipRepository(_context),
                    new ClientFamilyScreeningStageExtractor(_contactsEncounterRepository, _subscriberSystemRepository),
                    new ClientFamilyTracingStageExtractor(_contactsEncounterRepository, _subscriberSystemRepository));

            _clientStageExtractor             = new ClientStageExtractor(new PersonRepository(_context), _clientStageRepository, _subscriberSystemRepository, new ClientRepository(_context), new PracticeRepository(_context));
            _clientPretestStageExtractor      = new ClientPretestStageExtractor(_clientStageRepository, _clientPretestStageRepository, _subscriberSystemRepository, _clientEncounterRepository, new ClientRepository(_context));
            _clientStageRelationshipExtractor = new ClientStageRelationshipExtractor(new ClientRelationshipRepository(_context), new ClientStageRelationshipRepository(_context), _subscriberSystemRepository);
        }
Exemplo n.º 2
0
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();

            string connectionString = string.Empty;

            connectionString = config["connectionStrings:livehAPIConnection"];

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

            _context = new LiveHAPIContext(options);

            _clientPretestStageRepository = new ClientPretestStageRepository(_context);
            _clientEncounterRepository    = new ClientEncounterRepository(_context);
            _subscriberSystemRepository   = new SubscriberSystemRepository(_context);
            _practiceRepository           = new PracticeRepository(_context);
            _clientStageRepository        = new ClientStageRepository(_context);
            _contactsEncounterRepository  = new ContactsEncounterRepository(_context);


            _clientMessageLoader =
                new FamilyClientMessageLoader(

                    _practiceRepository, _clientStageRepository, new ClientStageRelationshipRepository(_context),
                    new ClientFamilyScreeningStageExtractor(_contactsEncounterRepository, _subscriberSystemRepository),
                    new ClientFamilyTracingStageExtractor(_contactsEncounterRepository, _subscriberSystemRepository));

            _clientMessageWriter =
                new FamilyWriter(new RestClient(_baseUrl), _clientMessageLoader, _clientStageRepository);
        }
Exemplo n.º 3
0
 public FamilyClientMessageWriter(IRestClient restClient, IFamilyClientMessageLoader loader,
                                  IClientStageRepository clientStageRepository) : base(restClient, loader, clientStageRepository)
 {
 }