forked from SixLabors/ImageSharp.Web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAzureBlobStorageCacheCacheFolderTestServerFixture.cs
33 lines (29 loc) · 1.38 KB
/
AzureBlobStorageCacheCacheFolderTestServerFixture.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
using Azure.Storage.Blobs.Models;
using Microsoft.Extensions.DependencyInjection;
using SixLabors.ImageSharp.Web.Caching.Azure;
using SixLabors.ImageSharp.Web.DependencyInjection;
using SixLabors.ImageSharp.Web.Providers.Azure;
namespace SixLabors.ImageSharp.Web.Tests.TestUtilities;
public class AzureBlobStorageCacheCacheFolderTestServerFixture : TestServerFixture
{
protected override void ConfigureCustomServices(IServiceCollection services, IImageSharpBuilder builder)
=> builder
.Configure<AzureBlobStorageImageProviderOptions>(o =>
o.BlobContainers.Add(
new AzureBlobContainerClientOptions
{
ConnectionString = TestConstants.AzureConnectionString,
ContainerName = TestConstants.AzureContainerName
}))
.AddProvider(AzureBlobStorageImageProviderFactory.Create)
.Configure<AzureBlobStorageCacheOptions>(o =>
{
o.ConnectionString = TestConstants.AzureConnectionString;
o.ContainerName = TestConstants.AzureCacheContainerName;
o.CacheFolder = TestConstants.AzureCacheFolder;
AzureBlobStorageCache.CreateIfNotExists(o, PublicAccessType.None);
})
.SetCache<AzureBlobStorageCache>();
}