You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -124,11 +132,22 @@ where repoOperations.Any(repo => repo.MatchesMethod(method))
124
132
varallTestMethods=q.Distinct().ToArray();
125
133
if(allTestMethods.Length>1)
126
134
{
127
-
varmessage="Calling one test method from another could result in unexpected behavior and must be avoided. Extract common mocking logic to a non-test method. At:\n"+stackTrace;
135
+
stringmessage="Calling one test method from another could result in unexpected behavior and must be avoided. Extract common mocking logic to a non-test method. At:\n"+stackTrace;
@@ -137,6 +156,10 @@ where repoOperations.Any(repo => repo.MatchesMethod(method))
137
156
&&!disableAttr.AllowMocking)
138
157
thrownewMockException("Using the mocking API in a test method decorated with DisableAutomaticRepositoryResetAttribute is unsafe. Read the documentation of the DisableAutomaticRepositoryResetAttribute class for further information and possible solutions.");
139
158
}
159
+
else
160
+
{
161
+
testMethod=AsyncContextResolver.GetContext();
162
+
}
140
163
141
164
repoIdx=0;
142
165
entryOps=null;
@@ -152,7 +175,7 @@ where repoOperations.Any(repo => repo.MatchesMethod(method))
152
175
}
153
176
}
154
177
155
-
JMDebug.Assert(entryOps!=null);
178
+
JMDebug.Assert(entryOps!=null);
156
179
}
157
180
158
181
returntestMethod;
@@ -162,7 +185,7 @@ private MocksRepository FindRepositoryInOps(RepositoryOperationsBase entryOps, o
0 commit comments