-
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
tests/ImageSharp.Web.Tests/Processing/AWSS3StorageCacheCacheFolderServerTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (c) Six Labors. | ||
// Licensed under the Six Labors Split License. | ||
|
||
using SixLabors.ImageSharp.Web.Tests.TestUtilities; | ||
using Xunit.Abstractions; | ||
|
||
namespace SixLabors.ImageSharp.Web.Tests.Processing; | ||
|
||
public class AWSS3StorageCacheCacheFolderServerTests : ServerTestBase<AWSS3StorageCacheCacheFolderTestServerFixture> | ||
{ | ||
public AWSS3StorageCacheCacheFolderServerTests(AWSS3StorageCacheCacheFolderTestServerFixture fixture, ITestOutputHelper outputHelper) | ||
: base(fixture, outputHelper, TestConstants.AWSTestImage) | ||
{ | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
tests/ImageSharp.Web.Tests/TestUtilities/AWSS3StorageCacheCacheFolderTestServerFixture.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) Six Labors. | ||
// Licensed under the Six Labors Split License. | ||
|
||
using Amazon.S3; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using SixLabors.ImageSharp.Web.Caching.AWS; | ||
using SixLabors.ImageSharp.Web.DependencyInjection; | ||
using SixLabors.ImageSharp.Web.Providers.AWS; | ||
|
||
namespace SixLabors.ImageSharp.Web.Tests.TestUtilities; | ||
|
||
public class AWSS3StorageCacheCacheFolderTestServerFixture : TestServerFixture | ||
{ | ||
protected override void ConfigureCustomServices(IServiceCollection services, IImageSharpBuilder builder) | ||
=> builder | ||
.Configure<AWSS3StorageImageProviderOptions>(o => | ||
o.S3Buckets.Add( | ||
new AWSS3BucketClientOptions | ||
{ | ||
Endpoint = TestConstants.AWSEndpoint, | ||
BucketName = TestConstants.AWSBucketName, | ||
AccessKey = TestConstants.AWSAccessKey, | ||
AccessSecret = TestConstants.AWSAccessSecret, | ||
Region = TestConstants.AWSRegion, | ||
Timeout = TestConstants.AWSTimeout, | ||
})) | ||
.AddProvider(AWSS3StorageImageProviderFactory.Create) | ||
.Configure<AWSS3StorageCacheOptions>(o => | ||
{ | ||
o.Endpoint = TestConstants.AWSEndpoint; | ||
o.BucketName = TestConstants.AWSCacheBucketName; | ||
o.AccessKey = TestConstants.AWSAccessKey; | ||
o.AccessSecret = TestConstants.AWSAccessSecret; | ||
o.Region = TestConstants.AWSRegion; | ||
o.Timeout = TestConstants.AWSTimeout; | ||
o.CacheFolder = TestConstants.AWSCacheFolder; | ||
|
||
AWSS3StorageCache.CreateIfNotExists(o, S3CannedACL.Private); | ||
}) | ||
.SetCache<AWSS3StorageCache>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters