-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
55 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// SPDX-FileCopyrightText: 2024 Frans van Dorsselaer | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
using System.Reflection; | ||
|
||
namespace UnitTests; | ||
|
||
[TestClass] | ||
sealed class TaskTests | ||
{ | ||
public required TestContext TestContext { get; set; } | ||
|
||
static string GetVersionFile() | ||
{ | ||
for (var directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); | ||
directory is not null; directory = Path.GetDirectoryName(directory)) | ||
{ | ||
var file = Path.Combine(directory, "obj", "gitversion.json"); | ||
if (File.Exists(file)) | ||
{ | ||
return file; | ||
} | ||
} | ||
throw new FileNotFoundException("gitversion.json"); | ||
} | ||
|
||
[TestMethod] | ||
public void GenerateGitVersionInformation_WithIntermediateOutputPath() | ||
{ | ||
var task = new Dorssel.GitVersion.MsBuild.GenerateGitVersionInformation | ||
{ | ||
VersionFile = GetVersionFile(), | ||
IntermediateOutputPath = TestContext.TestRunDirectory! | ||
}; | ||
var result = task.Execute(); | ||
Assert.IsTrue(result); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SPDX-FileCopyrightText: 2024 Frans van Dorsselaer | ||
|
||
SPDX-License-Identifier: MIT |