Skip to content

Commit b6aa9ef

Browse files
committed
Added static constructor in From.cs in order to initialize services if used outside of the normal test flow (closes #267)
1 parent 4578bfb commit b6aa9ef

File tree

1 file changed

+6
-0
lines changed
  • src/MyTested.AspNetCore.Mvc.Abstractions

1 file changed

+6
-0
lines changed

src/MyTested.AspNetCore.Mvc.Abstractions/From.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
namespace MyTested.AspNetCore.Mvc
22
{
3+
using Internal.Application;
34
using Internal.Services;
45

56
/// <summary>
67
/// Provides easy resolving of expression method argument values from the application <see cref="System.IServiceProvider"/>.
78
/// </summary>
89
public static class From
910
{
11+
static From()
12+
{
13+
TestApplication.TryInitialize();
14+
}
15+
1016
/// <summary>
1117
/// Indicates that a argument should be resolved from the application <see cref="System.IServiceProvider"/> in a method call lambda expression.
1218
/// </summary>

0 commit comments

Comments
 (0)