public void Setup() { var config = new ApplyConfig { FileStorage = new FileStorageConfig { FileEncryptionKey = _fileEncryptionKey } }; var _configurationService = new Mock <IConfigurationService>(); _configurationService.Setup(x => x.GetConfig()).ReturnsAsync(config); _fileEncryptionService = new FileEncryptionService(_configurationService.Object); }
public void OneTimeSetup() { var config = new ApplyConfig { FileStorage = new FileStorageConfig { StorageConnectionString = _fileStorageConnectionString, AssessorContainerName = _fileStorageContainerName } }; var _configurationService = new Mock <IConfigurationService>(); _configurationService.Setup(x => x.GetConfig()).ReturnsAsync(config); var logger = Mock.Of <ILogger <FileStorageService> >(); _fileStorageService = new FileStorageService(logger, _configurationService.Object); }
public void OneTimeSetup() { var config = new ApplyConfig { FileStorage = new FileStorageConfig { StorageConnectionString = _fileStorageConnectionString, AssessorContainerName = _fileStorageContainerName } }; var _configurationService = new Mock <IConfigurationService>(); _configurationService.Setup(x => x.GetConfig()).ReturnsAsync(config); var _fileEncryptionService = new Mock <IFileEncryptionService>(); _fileEncryptionService.Setup(x => x.Decrypt(It.IsAny <Stream>())).Returns <Stream>(x => x); // Don't Decrypt stream _fileEncryptionService.Setup(x => x.Encrypt(It.IsAny <Stream>())).Returns <Stream>(x => x); // Don't Encrypt stream var logger = Mock.Of <ILogger <FileStorageService> >(); _fileStorageService = new FileStorageService(logger, _configurationService.Object, _fileEncryptionService.Object); }