示例#1
0
        public void Init()
        {
            _exposureKeyMock   = new ExposureKeyMock();
            _countryFactory    = new CountryMockFactory();
            _mockServices      = new SetupMockedServices();
            _keyValidator      = new Mock <IKeyValidator>(MockBehavior.Strict);
            _logger            = new Mock <ILogger <KeyFilter> >();
            _repository        = new Mock <ITemporaryExposureKeyRepository>(MockBehavior.Strict);
            _countryRepository = new Mock <ICountryRepository>(MockBehavior.Strict);
            _mockServices.SetupMapperAndCountryRepositoryMock(_countryRepository);
            _keyMapper = _mockServices.CreateAutoMapperWithDependencies(_countryRepository.Object);
            _mockServices.SetupKeyValidatorMock(_keyValidator);
            _mockServices.SetupTemopraryExposureKeyRepositoryMock(_repository);

            var mapper = new ExposureKeyMapper();

            _keyFilter = new KeyFilter(_keyMapper, _keyValidator.Object, mapper, _logger.Object, _repository.Object);
        }
示例#2
0
        public void Init()
        {
            _riskCalulator     = new RiskCalculator();
            _exposureKeyMock   = new ExposureKeyMock();
            _webContextMock    = new WebContextMock();
            _mockSetup         = new SetupMockedServices();
            _webContextReader  = new Mock <IGatewayWebContextReader>(MockBehavior.Strict);
            _keyFilter         = new Mock <IKeyFilter>(MockBehavior.Strict);
            _tempKeyRepository = new Mock <ITemporaryExposureKeyRepository>(MockBehavior.Strict);
            _logger            = new Mock <ILogger <EFGSKeyStoreService> >();
            _epochConverter    = new EpochConverter();
            _onsetDaysDecoder  = new DaysSinceOnsetOfSymptomsDecoder();

            _mockSetup.SetupWebContextReaderMock(_webContextReader);
            _mockSetup.SetupKeyFilterMock(_keyFilter);
            _mockSetup.SetupTemopraryExposureKeyRepositoryMock(_tempKeyRepository);

            _keyStoreService = new EFGSKeyStoreService(_webContextReader.Object, _keyFilter.Object, _tempKeyRepository.Object, _logger.Object, _riskCalulator, _epochConverter, _onsetDaysDecoder);
        }