Skip to content

Commit

Permalink
Merge pull request #73 from bjuris/master
Browse files Browse the repository at this point in the history
SourceCodeLocationFinder should be re-used between test cases
  • Loading branch information
ivanz committed Nov 23, 2017
2 parents 260b7a7 + 1df1e8d commit 476344b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Source/Machine.VSTestAdapter/Discovery/BuiltIn/TestDiscoverer.cs
Expand Up @@ -24,15 +24,13 @@ public IEnumerable<MSpecTestCase> DiscoverTests(string assemblyPath)
Assembly assembly = AssemblyHelper.Load(assemblyPath);
IEnumerable<Context> contexts = assemblyExplorer.FindContextsIn(assembly);

return contexts.SelectMany(context => CreateTestCase(context, assemblyPath)).ToList();
}

private IEnumerable<MSpecTestCase> CreateTestCase(Context context, string assemblyPath)
{

SourceCodeLocationFinder locationFinder = new SourceCodeLocationFinder(assemblyPath);

return contexts.SelectMany(context => CreateTestCase(context, locationFinder)).ToList();
}

private IEnumerable<MSpecTestCase> CreateTestCase(Context context, SourceCodeLocationFinder locationFinder)
{
foreach (Specification spec in context.Specifications.ToList())
{
MSpecTestCase testCase = new MSpecTestCase();
Expand Down

0 comments on commit 476344b

Please sign in to comment.