1
- using System . Collections . Generic ;
1
+ using System ;
2
+ using System . Collections . Generic ;
2
3
using System . Collections . ObjectModel ;
3
4
using System . Security ;
4
5
using System . Windows . Forms ;
10
11
using Rubberduck . UI ;
11
12
using Rubberduck . UI . SourceControl ;
12
13
using Rubberduck . VBEditor . Application ;
13
- using Rubberduck . VBEditor . Events ;
14
14
using Rubberduck . VBEditor . SafeComWrappers ;
15
15
using Rubberduck . VBEditor . SafeComWrappers . Abstract ;
16
16
using RubberduckTests . Mocks ;
@@ -60,7 +60,8 @@ public void InitializeMocks()
60
60
_folderBrowser = new Mock < IFolderBrowser > ( ) ;
61
61
_folderBrowserFactory = new Mock < IFolderBrowserFactory > ( ) ;
62
62
_folderBrowserFactory . Setup ( f => f . CreateFolderBrowser ( It . IsAny < string > ( ) ) ) . Returns ( _folderBrowser . Object ) ;
63
- _folderBrowserFactory . Setup ( f => f . CreateFolderBrowser ( It . IsAny < string > ( ) , false ) ) . Returns ( _folderBrowser . Object ) ;
63
+ _folderBrowserFactory . Setup ( f => f . CreateFolderBrowser ( It . IsAny < string > ( ) , It . IsAny < bool > ( ) ) ) . Returns ( _folderBrowser . Object ) ;
64
+ _folderBrowserFactory . Setup ( f => f . CreateFolderBrowser ( It . IsAny < string > ( ) , It . IsAny < bool > ( ) , It . IsAny < string > ( ) ) ) . Returns ( _folderBrowser . Object ) ;
64
65
65
66
66
67
var masterRemote = new Mock < LibGit2Sharp . Branch > ( ) ;
@@ -121,7 +122,7 @@ private void SetupVM()
121
122
} ;
122
123
123
124
_vm = new SourceControlViewViewModel ( _vbe . Object , new RubberduckParserState ( _vbe . Object ) , _providerFactory . Object , _folderBrowserFactory . Object ,
124
- _configService . Object , views , new Mock < IMessageBox > ( ) . Object ) ;
125
+ _configService . Object , views , new Mock < IMessageBox > ( ) . Object , GetDummyEnvironment ( ) ) ;
125
126
}
126
127
127
128
[ TestCategory ( "SourceControl" ) ]
@@ -1050,7 +1051,7 @@ public void NullProject_DisplaysError()
1050
1051
1051
1052
private SourceControlSettings GetDummyConfig ( )
1052
1053
{
1053
- return new SourceControlSettings ( "username" , "username@email.com" , string . Empty ,
1054
+ return new SourceControlSettings ( "username" , "username@email.com" , @"C:\path\to" ,
1054
1055
new List < Repository > { GetDummyRepo ( ) } , "ps.exe" ) ;
1055
1056
}
1056
1057
@@ -1063,5 +1064,12 @@ private static Repository GetDummyRepo()
1063
1064
@"https://github.com/ckuhn203/SourceControlTest.git"
1064
1065
) ;
1065
1066
}
1067
+
1068
+ private static IEnvironmentProvider GetDummyEnvironment ( )
1069
+ {
1070
+ var environment = new Mock < IEnvironmentProvider > ( ) ;
1071
+ environment . Setup ( e => e . GetFolderPath ( Environment . SpecialFolder . MyDocuments ) ) . Returns ( @"C:\Users\Christopher\Documents" ) ;
1072
+ return environment . Object ;
1073
+ }
1066
1074
}
1067
1075
}
0 commit comments