Skip to content

Commit

Permalink
Fix #655
Browse files Browse the repository at this point in the history
  • Loading branch information
KateyBee committed Mar 28, 2024
1 parent a84bd6c commit b37e7d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Src/Directory.Build.props
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>

<Version>5.23.0.14-beta</Version>
<Version>5.23.0.15-beta</Version>

<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
Expand Down
4 changes: 4 additions & 0 deletions Src/Library/Testing/Factory.cs
@@ -1,7 +1,9 @@
using FluentValidation;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Json;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;

namespace FastEndpoints;

Expand Down Expand Up @@ -107,6 +109,8 @@ public static void AddTestServices(this HttpContext ctx, Action<IServiceCollecti
s(collection);
ctx.RequestServices = collection.BuildServiceProvider();
Cfg.ServiceResolver.Resolve<IHttpContextAccessor>().HttpContext = ctx;
if (ctx.RequestServices.GetService<IOptions<JsonOptions>>()?.Value.SerializerOptions is { } serializerOpts)
Cfg.SerOpts.Options = serializerOpts;
}

/// <summary>
Expand Down

0 comments on commit b37e7d9

Please sign in to comment.