Skip to content

Commit ef0a4c9

Browse files
committed
Fixed calling TryInitialize twice (#135 #168)
1 parent 9a42746 commit ef0a4c9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/MyTested.AspNetCore.Mvc.Abstractions/Internal/Application/TestApplication.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,14 @@ public static TestConfiguration Configuration()
197197

198198
public static void TryInitialize()
199199
{
200-
if (Configuration().General().NoStartup())
201-
{
202-
return;
203-
}
204-
205200
lock (Sync)
206201
{
207-
if (!initialiazed && Configuration().General().AutomaticStartup())
202+
var configuration = Configuration().General();
203+
204+
if (!initialiazed
205+
&& StartupType == null
206+
&& !configuration.NoStartup()
207+
&& configuration.AutomaticStartup())
208208
{
209209
var defaultStartupType = TryFindDefaultStartupType();
210210

0 commit comments

Comments
 (0)