Skip to content

Commit 476344b

Browse files
authored
Merge pull request #73 from bjuris/master
SourceCodeLocationFinder should be re-used between test cases
2 parents 260b7a7 + 1df1e8d commit 476344b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Source/Machine.VSTestAdapter/Discovery/BuiltIn/TestDiscoverer.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,13 @@ public IEnumerable<MSpecTestCase> DiscoverTests(string assemblyPath)
2424
Assembly assembly = AssemblyHelper.Load(assemblyPath);
2525
IEnumerable<Context> contexts = assemblyExplorer.FindContextsIn(assembly);
2626

27-
return contexts.SelectMany(context => CreateTestCase(context, assemblyPath)).ToList();
28-
}
29-
30-
private IEnumerable<MSpecTestCase> CreateTestCase(Context context, string assemblyPath)
31-
{
32-
3327
SourceCodeLocationFinder locationFinder = new SourceCodeLocationFinder(assemblyPath);
3428

29+
return contexts.SelectMany(context => CreateTestCase(context, locationFinder)).ToList();
30+
}
3531

32+
private IEnumerable<MSpecTestCase> CreateTestCase(Context context, SourceCodeLocationFinder locationFinder)
33+
{
3634
foreach (Specification spec in context.Specifications.ToList())
3735
{
3836
MSpecTestCase testCase = new MSpecTestCase();

0 commit comments

Comments
 (0)