Skip to content

Commit 97bea07

Browse files
Test OnBeforeLoadAsync
1 parent b86a433 commit 97bea07

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/ImageSharp.Web.Tests/TestUtilities/TestServerFixture.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Microsoft.AspNetCore.TestHost;
88
using Microsoft.Extensions.Configuration;
99
using Microsoft.Extensions.DependencyInjection;
10+
using SixLabors.ImageSharp.Formats;
1011
using SixLabors.ImageSharp.Web.DependencyInjection;
1112
using SixLabors.ImageSharp.Web.Middleware;
1213

@@ -67,6 +68,16 @@ protected void ConfigureServices(IServiceCollection services)
6768
return onParseCommandsAsync.Invoke(context);
6869
};
6970

71+
Func<HttpContext, DecoderOptions, Task> onBeforeLoadAsync = options.OnBeforeLoadAsync;
72+
73+
options.OnBeforeLoadAsync = (context, decoderOptions) =>
74+
{
75+
Assert.NotNull(context);
76+
Assert.NotNull(decoderOptions);
77+
78+
return onBeforeLoadAsync.Invoke(context, decoderOptions);
79+
};
80+
7081
Func<ImageProcessingContext, Task> onProcessedAsync = options.OnProcessedAsync;
7182

7283
options.OnProcessedAsync = context =>

0 commit comments

Comments
 (0)