20
20
using Rubberduck . Interaction ;
21
21
using Rubberduck . UI . UnitTesting . Commands ;
22
22
using Rubberduck . UnitTesting ;
23
+ using Rubberduck . UnitTesting . CodeGeneration ;
24
+ using Rubberduck . UnitTesting . Settings ;
25
+ using RubberduckTests . Settings ;
23
26
24
27
namespace RubberduckTests . CodeExplorer
25
28
{
@@ -30,6 +33,7 @@ internal class MockedCodeExplorer : IDisposable
30
33
private readonly Mock < IUiDispatcher > _uiDispatcher = new Mock < IUiDispatcher > ( ) ;
31
34
private readonly Mock < IConfigProvider < GeneralSettings > > _generalSettingsProvider = new Mock < IConfigProvider < GeneralSettings > > ( ) ;
32
35
private readonly Mock < IConfigProvider < WindowSettings > > _windowSettingsProvider = new Mock < IConfigProvider < WindowSettings > > ( ) ;
36
+ private readonly Mock < IConfigProvider < UnitTestSettings > > _unitTestSettingsProvider = new Mock < IConfigProvider < UnitTestSettings > > ( ) ;
33
37
private readonly Mock < ConfigurationLoader > _configLoader = new Mock < ConfigurationLoader > ( null , null , null , null , null , null , null , null ) ;
34
38
private readonly Mock < IVBEInteraction > _interaction = new Mock < IVBEInteraction > ( ) ;
35
39
@@ -38,6 +42,8 @@ public MockedCodeExplorer()
38
42
_generalSettingsProvider . Setup ( s => s . Create ( ) ) . Returns ( _generalSettings ) ;
39
43
_windowSettingsProvider . Setup ( s => s . Create ( ) ) . Returns ( WindowSettings ) ;
40
44
_configLoader . Setup ( c => c . LoadConfiguration ( ) ) . Returns ( GetDefaultUnitTestConfig ( ) ) ;
45
+ _unitTestSettingsProvider . Setup ( s => s . Create ( ) )
46
+ . Returns ( new UnitTestSettings ( BindingMode . LateBinding , AssertMode . StrictAssert , true , true , false ) ) ;
41
47
42
48
_uiDispatcher . Setup ( m => m . Invoke ( It . IsAny < Action > ( ) ) ) . Callback ( ( Action argument ) => argument . Invoke ( ) ) ;
43
49
@@ -271,7 +277,9 @@ public void ExecuteAddUserDocumentCommand()
271
277
272
278
public MockedCodeExplorer ImplementAddTestModuleCommand ( )
273
279
{
274
- ViewModel . AddTestModuleCommand = new AddTestComponentCommand ( Vbe . Object , State , _configLoader . Object , MessageBox . Object , _interaction . Object ) ;
280
+ var indenter = new Indenter ( null , ( ) => IndenterSettingsTests . GetMockIndenterSettings ( ) ) ;
281
+ var codeGenerator = new TestCodeGenerator ( Vbe . Object , State , MessageBox . Object , _interaction . Object , _unitTestSettingsProvider . Object , indenter ) ;
282
+ ViewModel . AddTestModuleCommand = new AddTestComponentCommand ( Vbe . Object , State , codeGenerator ) ;
275
283
return this ;
276
284
}
277
285
@@ -362,7 +370,7 @@ public void ExecuteIndenterCommand()
362
370
363
371
public MockedCodeExplorer ImplementIndenterCommand ( )
364
372
{
365
- ViewModel . IndenterCommand = new IndentCommand ( State , new Indenter ( Vbe . Object , ( ) => Settings . IndenterSettingsTests . GetMockIndenterSettings ( ) ) , null ) ;
373
+ ViewModel . IndenterCommand = new IndentCommand ( State , new Indenter ( Vbe . Object , ( ) => IndenterSettingsTests . GetMockIndenterSettings ( ) ) , null ) ;
366
374
return this ;
367
375
}
368
376
0 commit comments