Beispiel #1
0
        public void TestUpload()
        {
            //Arrange
            var uploadConfig = new UploadKeysToGatewayJobConfig()
            {
                BatchSize = 10000, UploadKeysAgeLimitInDays = 7
            };
            var euServiceMock = new Mock <IEuGatewayService>();
            var configMock    = new Mock <UploadKeysToGatewayJobConfig>();
            var loggerMock    = new Mock <ILogger <UploadTemporaryExposureKeysEuGatewayJob> >();

            euServiceMock.Setup(mock => mock.UploadKeysToTheGateway(uploadConfig.UploadKeysAgeLimitInDays, uploadConfig.BatchSize, null)).Verifiable();
            var uploadEuKeysJob = new UploadTemporaryExposureKeysEuGatewayJob(
                uploadConfig,
                euServiceMock.Object,
                loggerMock.Object
                );

            //Act
            var uploadEuKeysJobAction = new Action(() => uploadEuKeysJob.Invoke());

            //Assert
            uploadEuKeysJobAction.Should().NotThrow();
            euServiceMock.Verify(mock => mock.UploadKeysToTheGateway(uploadConfig.UploadKeysAgeLimitInDays, uploadConfig.BatchSize, null), Times.Once);
        }
Beispiel #2
0
 public UploadTemporaryExposureKeysEuGatewayJob(UploadKeysToGatewayJobConfig config, IEuGatewayService euGatewayService, ILogger <UploadTemporaryExposureKeysEuGatewayJob> logger)
 {
     _config           = config;
     _euGatewayService = euGatewayService;
     _logger           = logger;
 }