public async Task ArgumentCheckStorageTypeFileSystemReturnsNull() { // Arrange var appCopnfiguration = new Mock <IAppConfiguration>(); appCopnfiguration.SetupGet(c => c.StorageType).Returns(StorageType.FileSystem); var cloudStorageStatusDependency1 = CloudStorageStatusDependencyFactory.GetCloudStorageStatusDependency(ICloudStorageStatusDependencyTestType.Available, appCopnfiguration.Object); var statusTestService = new StatusService(entities: null, cloudStorageAvailabilityChecks: new ICloudStorageStatusDependency[] { cloudStorageStatusDependency1 }, config: appCopnfiguration.Object); var result = await statusTestService.IsAzureStorageAvailable(); // Assert Assert.Null(result); }
public async Task AtLeastOneNotAvailableStoragesReturnsNotAvailable(bool readOnly) { // Arrange var appCopnfiguration = new Mock <IAppConfiguration>(); appCopnfiguration.SetupGet(c => c.ReadOnlyMode).Returns(readOnly); appCopnfiguration.SetupGet(c => c.StorageType).Returns(StorageType.AzureStorage); var cloudStorageStatusDependency1 = CloudStorageStatusDependencyFactory.GetCloudStorageStatusDependency(ICloudStorageStatusDependencyTestType.Available, appCopnfiguration.Object); var cloudStorageStatusDependency2 = CloudStorageStatusDependencyFactory.GetCloudStorageStatusDependency(ICloudStorageStatusDependencyTestType.NotAvailable, appCopnfiguration.Object); var statusTestService = new StatusService(entities: null, cloudStorageAvailabilityChecks: new ICloudStorageStatusDependency[] { cloudStorageStatusDependency1, cloudStorageStatusDependency2 }, config: appCopnfiguration.Object); var result = await statusTestService.IsAzureStorageAvailable(); // Assert Assert.False(result.Value); }