Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit c1558a5

Browse files
committed
Adding donwloading the files to the git installer test
1 parent 577e243 commit c1558a5

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

src/tests/IntegrationTests/Installer/GitInstallerTests.cs

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Threading;
3+
using System.Threading.Tasks;
34
using FluentAssertions;
45
using GitHub.Unity;
56
using NSubstitute;
@@ -10,24 +11,42 @@ namespace IntegrationTests
1011
[TestFixture]
1112
class GitInstallerTests : BaseTaskManagerTest
1213
{
13-
[Test]
14-
public void GitInstallTest()
14+
const int Timeout = 30000;
15+
public override void OnSetup()
1516
{
16-
InitializeTaskManager();
17+
base.OnSetup();
18+
InitializeEnvironment(TestBasePath, initializeRepository: false);
19+
}
1720

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+
}
2029

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+
{
2140
var gitInstallationPath = TestBasePath.Combine("GitInstall").CreateDirectory();
2241

2342
var installDetails = new GitInstallDetails(gitInstallationPath, DefaultEnvironment.OnWindows);
2443

25-
var zipArchivesPath = TestBasePath.Combine("ZipArchives").CreateDirectory();
44+
//var zipArchivesPath = TestBasePath.Combine("ZipArchives").CreateDirectory();
2645

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);
2948

30-
var gitInstaller = new GitInstaller(Environment, CancellationToken.None, installDetails, gitArchivePath, gitLfsArchivePath);
49+
var gitInstaller = new GitInstaller(Environment, CancellationToken.None, installDetails);
3150

3251
var autoResetEvent = new AutoResetEvent(false);
3352

0 commit comments

Comments
 (0)