@@ -17,8 +17,8 @@ namespace RubberduckTests.Mocks
17
17
[ SuppressMessage ( "Microsoft.Design" , "CA1001" ) ] //CA1001 is complaining about RubberduckTests.Mocks.Windows, which doesn't need to be disposed in this context.
18
18
public class MockVbeBuilder
19
19
{
20
- public static string TestProjectName { set ; get ; } = "TestProject1" ;
21
- public static string TestModuleName { set ; get ; } = "TestModule1" ;
20
+ public const string TestProjectName = "TestProject1" ;
21
+ public const string TestModuleName = "TestModule1" ;
22
22
private readonly Mock < IVBE > _vbe ;
23
23
private readonly Mock < IVbeEvents > _vbeEvents ;
24
24
@@ -177,47 +177,53 @@ public static Mock<IVBE> BuildFromSingleModule(string content, string name, Comp
177
177
}
178
178
179
179
/// <summary>
180
- /// Builds a mock VBE containing multiple standard modules.
180
+ /// Builds a mock VBE containing a single "TestProject1" and multiple standard modules.
181
181
/// </summary>
182
182
public static Mock < IVBE > BuildFromStdModules ( params ( string name , string content ) [ ] modules )
183
183
{
184
184
return BuildFromModules ( modules . Select ( tpl => ( tpl . name , tpl . content , ComponentType . StandardModule ) ) ) ;
185
185
}
186
186
187
187
/// <summary>
188
- /// Builds a mock VBE containing one project with multiple modules.
188
+ /// Builds a mock VBE containing a single "TestProject1" with multiple modules.
189
189
/// </summary>
190
190
public static Mock < IVBE > BuildFromModules ( params ( string name , string content , ComponentType componentType ) [ ] modules )
191
191
{
192
192
return BuildFromModules ( ( IEnumerable < ( string name , string content , ComponentType componentType ) > ) modules ) ;
193
193
}
194
194
195
195
/// <summary>
196
- /// Builds a mock VBE containing one project with multiple modules.
196
+ /// Builds a mock VBE containing a single "TestProject1" with multiple modules.
197
197
/// </summary>
198
198
public static Mock < IVBE > BuildFromModules ( IEnumerable < ( string name , string content , ComponentType componentType ) > modules )
199
199
=> BuildFromModules ( modules , Enumerable . Empty < string > ( ) ) ;
200
200
201
201
/// <summary>
202
- /// Builds a mock VBE containing one project with one module and one library .
202
+ /// Builds a mock VBE containing a single "TestProject1" with one module and one or more libraries .
203
203
/// </summary>
204
- public static Mock < IVBE > BuildFromModules ( ( string name , string content , ComponentType componentType ) module , string library )
205
- => BuildFromModules ( new ( string , string , ComponentType ) [ ] { module } , new string [ ] { library } ) ;
204
+ public static Mock < IVBE > BuildFromModules ( ( string name , string content , ComponentType componentType ) module , params string [ ] libraries )
205
+ => BuildFromModules ( new ( string , string , ComponentType ) [ ] { module } , libraries ) ;
206
206
207
207
/// <summary>
208
- /// Builds a mock VBE containing one project with one module and multiple libraries.
208
+ /// Builds a mock VBE containing a single "TestProject1" with one module and multiple libraries.
209
209
/// </summary>
210
210
public static Mock < IVBE > BuildFromModules ( ( string name , string content , ComponentType componentType ) module , IEnumerable < string > libraries )
211
- => BuildFromModules ( new ( string , string , ComponentType ) [ ] { module } , libraries ) ;
211
+ => BuildFromModules ( new ( string , string , ComponentType ) [ ] { module } , libraries ) ;
212
212
213
213
/// <summary>
214
- /// Builds a mock VBE containing one project with multiple modules and libraries.
214
+ /// Builds a mock VBE containing a single "TestProject1" with multiple modules and libraries.
215
215
/// </summary>
216
216
public static Mock < IVBE > BuildFromModules ( IEnumerable < ( string name , string content , ComponentType componentType ) > modules , IEnumerable < string > libraryNames )
217
+ => BuildFromModules ( TestProjectName , modules , libraryNames ) ;
218
+
219
+ /// <summary>
220
+ /// Builds a mock VBE containing one project with multiple modules and libraries.
221
+ /// </summary>
222
+ public static Mock < IVBE > BuildFromModules ( string projectName , IEnumerable < ( string name , string content , ComponentType componentType ) > modules , IEnumerable < string > libraryNames )
217
223
{
218
224
var vbeBuilder = new MockVbeBuilder ( ) ;
219
225
220
- var builder = vbeBuilder . ProjectBuilder ( TestProjectName , ProjectProtection . Unprotected ) ;
226
+ var builder = vbeBuilder . ProjectBuilder ( projectName , ProjectProtection . Unprotected ) ;
221
227
foreach ( var ( name , content , componentType ) in modules )
222
228
{
223
229
builder . AddComponent ( name , componentType , content ) ;
0 commit comments