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

Commit 9426ca4

Browse files
Fixing tests
1 parent ab5af34 commit 9426ca4

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/tests/IntegrationTests/Installer/GitInstallerTests.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Threading;
3+
using FluentAssertions;
34
using GitHub.Unity;
45
using NSubstitute;
56
using NUnit.Framework;
@@ -22,36 +23,35 @@ public void GitInstallTest()
2223
var installDetails = new GitInstallDetails(gitInstallationPath, DefaultEnvironment.OnWindows);
2324

2425
var zipArchivesPath = TestBasePath.Combine("ZipArchives").CreateDirectory();
26+
2527
var gitArchivePath = AssemblyResources.ToFile(ResourceType.Platform, "git.zip", zipArchivesPath, Environment);
2628
var gitLfsArchivePath = AssemblyResources.ToFile(ResourceType.Platform, "git-lfs.zip", zipArchivesPath, Environment);
27-
29+
2830
var gitInstaller = new GitInstaller(Environment, CancellationToken.None, installDetails, gitArchivePath, gitLfsArchivePath);
2931

3032
var autoResetEvent = new AutoResetEvent(false);
3133

32-
NPath result = null;
34+
bool? result = null;
35+
NPath resultPath = null;
3336
Exception ex = null;
3437

3538
gitInstaller.SetupGitIfNeeded(new ActionTask<NPath>(CancellationToken.None, (b, path) => {
36-
result = path;
39+
result = true;
40+
resultPath = path;
3741
autoResetEvent.Set();
3842
}),
3943
new ActionTask(CancellationToken.None, (b, exception) => {
44+
result = false;
4045
ex = exception;
4146
autoResetEvent.Set();
4247
}));
4348

4449
autoResetEvent.WaitOne();
4550

46-
if (result == null)
47-
{
48-
if (ex != null)
49-
{
50-
throw ex;
51-
}
52-
53-
throw new Exception("Did not install git");
54-
}
51+
result.HasValue.Should().BeTrue();
52+
result.Value.Should().BeTrue();
53+
resultPath.Should().NotBeNull();
54+
ex.Should().BeNull();
5555
}
5656
}
5757
}

0 commit comments

Comments
 (0)