@@ -141,25 +141,37 @@ public IEnumerable<ProjectId> AddFilesToWorkspace(params TestFile[] testFiles)
141
141
public IEnumerable < ProjectId > AddFilesToWorkspace ( string folderPath , params TestFile [ ] testFiles )
142
142
{
143
143
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
+ }
156
168
157
169
foreach ( var csxFile in testFiles . Where ( f => f . FileName . EndsWith ( ".csx" , StringComparison . OrdinalIgnoreCase ) ) )
158
170
{
159
171
TestHelpers . AddCsxProjectToWorkspace ( Workspace , csxFile ) ;
160
172
}
161
173
162
- return csProjects . Concat ( vbProjects ) ;
174
+ return projects ;
163
175
}
164
176
165
177
public void ClearWorkspace ( )
0 commit comments