public void Should_Property_Set_And_Get_Options_For_Different_Containers() { var testContainer1Config = _configurationProvider.Get <TestContainer1>(); testContainer1Config.ProviderType.ShouldBe(typeof(FakeBlobProvider1)); testContainer1Config.GetConfigurationOrDefault <string>("TestConfig1").ShouldBe("TestValue1"); testContainer1Config.GetConfigurationOrDefault <string>("TestConfigDefault").ShouldBe("TestValueDefault"); var testContainer2Config = _configurationProvider.Get <TestContainer2>(); testContainer2Config.ProviderType.ShouldBe(typeof(FakeBlobProvider2)); testContainer2Config.GetConfigurationOrNull("TestConfig2").ShouldBe("TestValue2"); testContainer2Config.GetConfigurationOrNull("TestConfigDefault").ShouldBe("TestValueDefault"); }
public virtual Task <BlobContainerConfigurationDto> GetBlobContainerConfigurationAsync([NotNull] string containerName) { var configuration = _configurationProvider.Get(containerName); var authorizationHandlerConfiguration = new AuthorizationHandlerConfiguration(configuration); var blobSizeLimitHandlerConfiguration = new BlobSizeLimitHandlerConfiguration(configuration); var fileTypeCheckHandlerConfiguration = new FileTypeCheckHandlerConfiguration(configuration); var imageProcessHandlerConfiguration = new ImageProcessHandlerConfiguration(configuration); return(Task.FromResult( new BlobContainerConfigurationDto( new AuthorizationHandlerConfigurationDto(authorizationHandlerConfiguration.SavingPolicy, authorizationHandlerConfiguration.SavingRoles, authorizationHandlerConfiguration.GettingPolicy, authorizationHandlerConfiguration.GettingRoles, authorizationHandlerConfiguration.DeletingPolicy, authorizationHandlerConfiguration.DeletingRoles), new BlobSizeLimitHandlerConfigurationDto(blobSizeLimitHandlerConfiguration.MaximumBlobSize), new FileTypeCheckHandlerConfigurationDto(fileTypeCheckHandlerConfiguration.AllowedFileTypeNames), new ImageProcessHandlerConfigurationDto(imageProcessHandlerConfiguration.ImageWidth, imageProcessHandlerConfiguration.ImageHeight, imageProcessHandlerConfiguration.ImageSizeMustBeLargerThanPreset) ) )); }
public static BlobContainerConfiguration Get <TContainer>( this IBlobContainerConfigurationProvider configurationProvider) { return(configurationProvider.Get(BlobContainerNameAttribute.GetContainerName <TContainer>())); }