Skip to content

Commit a794f58

Browse files
committed
Fix failing tests
1 parent 199ac1c commit a794f58

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

tests/TestUtility/OmniSharpTestHost.cs

+25-13
Original file line numberDiff line numberDiff line change
@@ -141,25 +141,37 @@ public IEnumerable<ProjectId> AddFilesToWorkspace(params TestFile[] testFiles)
141141
public IEnumerable<ProjectId> AddFilesToWorkspace(string folderPath, params TestFile[] testFiles)
142142
{
143143
folderPath = folderPath ?? Directory.GetCurrentDirectory();
144-
var csProjects = TestHelpers.AddProjectToWorkspace(
145-
Workspace,
146-
Path.Combine(folderPath, "project.csproj"),
147-
new[] { "net472" },
148-
testFiles.Where(f => f.FileName.EndsWith(".cs", StringComparison.OrdinalIgnoreCase)).ToArray());
149-
150-
var vbProjects = TestHelpers.AddProjectToWorkspace(
151-
Workspace,
152-
Path.Combine(folderPath, "project.vbproj"),
153-
new[] { "net472" },
154-
testFiles.Where(f => f.FileName.EndsWith(".vb", StringComparison.OrdinalIgnoreCase)).ToArray(),
155-
languageName: LanguageNames.VisualBasic);
144+
145+
IEnumerable<ProjectId> projects = Enumerable.Empty<ProjectId>();
146+
var csFiles = testFiles.Where(f => f.FileName.EndsWith(".cs", StringComparison.OrdinalIgnoreCase)).ToArray();
147+
var vbFiles = testFiles.Where(f => f.FileName.EndsWith(".vb", StringComparison.OrdinalIgnoreCase)).ToArray();
148+
149+
projects.Concat(
150+
TestHelpers.AddProjectToWorkspace(
151+
Workspace,
152+
Path.Combine(folderPath, "project.csproj"),
153+
new[] { "net472" },
154+
csFiles)
155+
);
156+
157+
if (vbFiles.Length > 0)
158+
{
159+
projects.Concat(
160+
TestHelpers.AddProjectToWorkspace(
161+
Workspace,
162+
Path.Combine(folderPath, "project.vbproj"),
163+
new[] { "net472" },
164+
vbFiles,
165+
languageName: LanguageNames.VisualBasic)
166+
);
167+
}
156168

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

162-
return csProjects.Concat(vbProjects);
174+
return projects;
163175
}
164176

165177
public void ClearWorkspace()

0 commit comments

Comments
 (0)