Ejemplo n.º 1
0
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();

            //var connectionString = config["connectionStrings:hAPIConnection"].Replace("#dir#", TestContext.CurrentContext.TestDirectory.HasToEndWith(@"\"));

            var connectionString = config["connectionStrings:livehAPIConnection"];


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

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

            _repository = new UserRepository(_context);

            _clientStageRepository             = new ClientStageRepository(_context);
            _clientStageRelationshipRepository = new ClientStageRelationshipRepository(_context);
            _clientRepository             = new ClientRepository(_context);
            _clientPretestStageRepository = new ClientPretestStageRepository(_context);
            var clientStageExtractor =
                new ClientStageExtractor(new PersonRepository(_context), new ClientStageRepository(_context), new SubscriberSystemRepository(_context), new ClientRepository(_context), new PracticeRepository(_context));
            var clientStageRelationshipExtractor =
                new ClientStageRelationshipExtractor(new ClientRelationshipRepository(_context), new ClientStageRelationshipRepository(_context), new SubscriberSystemRepository(_context));
            var clientPretestStageExtractor =
                new ClientPretestStageExtractor(new ClientStageRepository(_context), new ClientPretestStageRepository(_context), new SubscriberSystemRepository(_context), new ClientEncounterRepository(_context), new ClientRepository(_context));

            _service = new ExtractClientsService(clientStageExtractor, clientStageRelationshipExtractor, clientPretestStageExtractor);
        }
        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);
        }
Ejemplo n.º 3
0
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();
            var 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 PartnerClientMessageLoader(

                    _practiceRepository, _clientStageRepository, new ClientStageRelationshipRepository(_context),
                    new ClientPartnerScreeningStageExtractor(_contactsEncounterRepository, _subscriberSystemRepository),
                    new ClientPartnerTracingStageExtractor(_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);
        }
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();

            string connectionString = string.Empty;

            if (goLive)
            {
                connectionString = config["connectionStrings:livehAPIConnection"];
            }
            else
            {
                connectionString = config["connectionStrings:hAPIConnection"].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);

            _clientStageExtractor        = new ClientStageExtractor(new PersonRepository(_context), _clientStageRepository, _subscriberSystemRepository, new ClientRepository(_context), new PracticeRepository(_context));
            _clientPretestStageExtractor = new ClientPretestStageExtractor(_clientStageRepository, _clientPretestStageRepository, _subscriberSystemRepository, _clientEncounterRepository, new ClientRepository(_context));


            _clientMessageLoader =
                new IndexClientMessageLoader(_practiceRepository, _clientStageRepository, _clientPretestStageRepository,
                                             new ClientTestingStageExtractor(_clientEncounterRepository, _subscriberSystemRepository),
                                             new ClientFinalTestStageExtractor(_clientEncounterRepository, _subscriberSystemRepository),
                                             new ClientReferralStageExtractor(_clientEncounterRepository, _subscriberSystemRepository),
                                             new ClientTracingStageExtractor(_clientEncounterRepository, _subscriberSystemRepository),
                                             new ClientLinkageStageExtractor(_clientEncounterRepository, _subscriberSystemRepository)

                                             );

            _clientMessageWriter =
                new IndexClientMessageWriter(new RestClient(_baseUrl), _clientMessageLoader, _clientStageRepository);
        }
Ejemplo n.º 5
0
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();
            //var connectionString = config["connectionStrings:hAPIConnection"].Replace("#dir#", TestContext.CurrentContext.TestDirectory.HasToEndWith(@"\"));
            var connectionString = config["connectionStrings:livehAPIConnection"];

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

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

            var clientPretestStageRepository = new ClientPretestStageRepository(_context);
            var clientEncounterRepository    = new ClientEncounterRepository(_context);
            var subscriberSystemRepository   = new SubscriberSystemRepository(_context);
            var practiceRepository           = new PracticeRepository(_context);
            var clientStageRepository        = new ClientStageRepository(_context);

            var clientStageExtractor        = new ClientStageExtractor(new PersonRepository(_context), clientStageRepository, subscriberSystemRepository, new ClientRepository(_context), new PracticeRepository(_context));
            var clientPretestStageExtractor = new ClientPretestStageExtractor(clientStageRepository, clientPretestStageRepository, subscriberSystemRepository, clientEncounterRepository, new ClientRepository(_context));
            var contactsEncounterRepository = new ContactsEncounterRepository(_context);

            var clientMessageLoader =
                new IndexClientMessageLoader(practiceRepository, clientStageRepository, clientPretestStageRepository,
                                             new ClientTestingStageExtractor(clientEncounterRepository, subscriberSystemRepository),
                                             new ClientFinalTestStageExtractor(clientEncounterRepository, subscriberSystemRepository),
                                             new ClientReferralStageExtractor(clientEncounterRepository, subscriberSystemRepository),
                                             new ClientTracingStageExtractor(clientEncounterRepository, subscriberSystemRepository),
                                             new ClientLinkageStageExtractor(clientEncounterRepository, subscriberSystemRepository)

                                             );


            var clientMessageWriter =
                new IndexClientMessageWriter(new RestClient(_baseUrl), clientMessageLoader, clientStageRepository);


            var cclientMessageLoader =
                new FamilyClientMessageLoader(

                    practiceRepository, clientStageRepository, new ClientStageRelationshipRepository(_context),
                    new ClientFamilyScreeningStageExtractor(contactsEncounterRepository, subscriberSystemRepository),
                    new ClientFamilyTracingStageExtractor(contactsEncounterRepository, subscriberSystemRepository));

            var cclientMessageWriter =
                new FamilyClientMessageWriter(new RestClient(_baseUrl), cclientMessageLoader, clientStageRepository);

            var ccclientMessageLoader =
                new PartnerClientMessageLoader(
                    practiceRepository, clientStageRepository, new ClientStageRelationshipRepository(_context),
                    new ClientPartnerScreeningStageExtractor(contactsEncounterRepository, subscriberSystemRepository),
                    new ClientPartnerTracingStageExtractor(contactsEncounterRepository, subscriberSystemRepository));

            var ccclientMessageWriter =
                new PartnerClientMessageWriter(new RestClient(_baseUrl), ccclientMessageLoader, clientStageRepository);

            _service = new SyncClientsService(clientMessageWriter, ccclientMessageWriter, cclientMessageWriter);
        }