Skip to content

Commit f1296b1

Browse files
authored
Merge pull request #3820 from GitTools/dependabot/nuget/src/NUnit-4.0.1
(deps): Bump NUnit from 3.14.0 to 4.0.1 in /src
2 parents f0fab56 + 4fbb2d9 commit f1296b1

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

src/Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
2222
<PackageVersion Include="Microsoft.Win32.Registry" Version="6.0.0-preview.5.21301.5" />
2323
<PackageVersion Include="NSubstitute" Version="5.1.0" />
24-
<PackageVersion Include="NUnit" Version="3.14.0" />
24+
<PackageVersion Include="NUnit" Version="4.0.1" />
2525
<PackageVersion Include="NUnit.Analyzers" Version="3.10.0" />
2626
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
2727
<PackageVersion Include="Polly" Version="8.2.0" />

src/GitVersion.Core.Tests/Core/GitVersionToolDirectoryTests.cs

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void SetUp()
2626
[Test]
2727
public void FindsGitDirectory()
2828
{
29-
try
29+
var exception = Assert.Catch(() =>
3030
{
3131
var options = Options.Create(new GitVersionOptions { WorkingDirectory = workDirectory, Settings = { NoFetch = true } });
3232

@@ -35,13 +35,8 @@ public void FindsGitDirectory()
3535
var gitVersionCalculator = sp.GetRequiredService<IGitVersionCalculateTool>();
3636

3737
gitVersionCalculator.CalculateVersionVariables();
38-
}
39-
catch (Exception ex)
40-
{
41-
// `RepositoryNotFoundException` means that it couldn't find the .git directory,
42-
// any other exception means that the .git was found but there was some other issue that this test doesn't care about.
43-
Assert.IsNotAssignableFrom<RepositoryNotFoundException>(ex);
44-
}
38+
});
39+
exception.ShouldNotBeAssignableTo<RepositoryNotFoundException>();
4540
}
4641

4742
[Test]
@@ -50,7 +45,7 @@ public void FindsGitDirectoryInParent()
5045
var childDir = PathHelper.Combine(this.workDirectory, "child");
5146
Directory.CreateDirectory(childDir);
5247

53-
try
48+
var exception = Assert.Catch(() =>
5449
{
5550
var options = Options.Create(new GitVersionOptions { WorkingDirectory = childDir, Settings = { NoFetch = true } });
5651

@@ -59,13 +54,7 @@ public void FindsGitDirectoryInParent()
5954
var gitVersionCalculator = sp.GetRequiredService<IGitVersionCalculateTool>();
6055

6156
gitVersionCalculator.CalculateVersionVariables();
62-
}
63-
catch (Exception ex)
64-
{
65-
// TODO I think this test is wrong.. It throws a different exception
66-
// `RepositoryNotFoundException` means that it couldn't find the .git directory,
67-
// any other exception means that the .git was found but there was some other issue that this test doesn't care about.
68-
Assert.IsNotAssignableFrom<RepositoryNotFoundException>(ex);
69-
}
57+
});
58+
exception.ShouldNotBeAssignableTo<RepositoryNotFoundException>();
7059
}
7160
}

0 commit comments

Comments
 (0)