1
1
using System ;
2
2
using System . Threading ;
3
+ using System . Threading . Tasks ;
3
4
using FluentAssertions ;
4
5
using GitHub . Unity ;
5
6
using NSubstitute ;
@@ -10,24 +11,42 @@ namespace IntegrationTests
10
11
[ TestFixture ]
11
12
class GitInstallerTests : BaseTaskManagerTest
12
13
{
13
- [ Test ]
14
- public void GitInstallTest ( )
14
+ const int Timeout = 30000 ;
15
+ public override void OnSetup ( )
15
16
{
16
- InitializeTaskManager ( ) ;
17
+ base . OnSetup ( ) ;
18
+ InitializeEnvironment ( TestBasePath , initializeRepository : false ) ;
19
+ }
17
20
18
- var cacheContainer = Substitute . For < ICacheContainer > ( ) ;
19
- Environment = new IntegrationTestEnvironment ( cacheContainer , TestBasePath , SolutionDirectory , enableTrace : true ) ;
21
+ private TestWebServer . HttpServer server ;
22
+ public override void TestFixtureSetUp ( )
23
+ {
24
+ base . TestFixtureSetUp ( ) ;
25
+ server = new TestWebServer . HttpServer ( SolutionDirectory . Combine ( "files" ) ) ;
26
+ Task . Factory . StartNew ( server . Start ) ;
27
+ ApplicationConfiguration . WebTimeout = 5000 ;
28
+ }
20
29
30
+ public override void TestFixtureTearDown ( )
31
+ {
32
+ base . TestFixtureTearDown ( ) ;
33
+ server . Stop ( ) ;
34
+ ApplicationConfiguration . WebTimeout = ApplicationConfiguration . DefaultWebTimeout ;
35
+ }
36
+
37
+ [ Test ]
38
+ public void GitInstallTest ( )
39
+ {
21
40
var gitInstallationPath = TestBasePath . Combine ( "GitInstall" ) . CreateDirectory ( ) ;
22
41
23
42
var installDetails = new GitInstallDetails ( gitInstallationPath , DefaultEnvironment . OnWindows ) ;
24
43
25
- var zipArchivesPath = TestBasePath . Combine ( "ZipArchives" ) . CreateDirectory ( ) ;
44
+ // var zipArchivesPath = TestBasePath.Combine("ZipArchives").CreateDirectory();
26
45
27
- var gitArchivePath = AssemblyResources . ToFile ( ResourceType . Platform , "git.zip" , zipArchivesPath , Environment ) ;
28
- var gitLfsArchivePath = AssemblyResources . ToFile ( ResourceType . Platform , "git-lfs.zip" , zipArchivesPath , Environment ) ;
46
+ // var gitArchivePath = AssemblyResources.ToFile(ResourceType.Platform, "git.zip", zipArchivesPath, Environment);
47
+ // var gitLfsArchivePath = AssemblyResources.ToFile(ResourceType.Platform, "git-lfs.zip", zipArchivesPath, Environment);
29
48
30
- var gitInstaller = new GitInstaller ( Environment , CancellationToken . None , installDetails , gitArchivePath , gitLfsArchivePath ) ;
49
+ var gitInstaller = new GitInstaller ( Environment , CancellationToken . None , installDetails ) ;
31
50
32
51
var autoResetEvent = new AutoResetEvent ( false ) ;
33
52
0 commit comments