Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef1313 committed Feb 15, 2021
1 parent 199ac1c commit a8d361f
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions tests/TestUtility/OmniSharpTestHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,25 +141,34 @@ public IEnumerable<ProjectId> AddFilesToWorkspace(params TestFile[] testFiles)
public IEnumerable<ProjectId> AddFilesToWorkspace(string folderPath, params TestFile[] testFiles)
{
folderPath = folderPath ?? Directory.GetCurrentDirectory();
var csProjects = TestHelpers.AddProjectToWorkspace(
Workspace,
Path.Combine(folderPath, "project.csproj"),
new[] { "net472" },
testFiles.Where(f => f.FileName.EndsWith(".cs", StringComparison.OrdinalIgnoreCase)).ToArray());

var vbProjects = TestHelpers.AddProjectToWorkspace(
Workspace,
Path.Combine(folderPath, "project.vbproj"),
new[] { "net472" },
testFiles.Where(f => f.FileName.EndsWith(".vb", StringComparison.OrdinalIgnoreCase)).ToArray(),
languageName: LanguageNames.VisualBasic);

var csFiles = testFiles.Where(f => f.FileName.EndsWith(".cs", StringComparison.OrdinalIgnoreCase)).ToArray();
var vbFiles = testFiles.Where(f => f.FileName.EndsWith(".vb", StringComparison.OrdinalIgnoreCase)).ToArray();

var projects = TestHelpers.AddProjectToWorkspace(
Workspace,
Path.Combine(folderPath, "project.csproj"),
new[] { "net472" },
csFiles);

if (vbFiles.Length > 0)
{
projects = projects.Concat(
TestHelpers.AddProjectToWorkspace(
Workspace,
Path.Combine(folderPath, "project.vbproj"),
new[] { "net472" },
vbFiles,
languageName: LanguageNames.VisualBasic)
);
}

foreach (var csxFile in testFiles.Where(f => f.FileName.EndsWith(".csx", StringComparison.OrdinalIgnoreCase)))
{
TestHelpers.AddCsxProjectToWorkspace(Workspace, csxFile);
}

return csProjects.Concat(vbProjects);
return projects;
}

public void ClearWorkspace()
Expand Down

0 comments on commit a8d361f

Please sign in to comment.