-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce length of temp directory path
- Loading branch information
Showing
4 changed files
with
33 additions
and
3 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
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
24 changes: 24 additions & 0 deletions
24
Sources/Kysect.CommonLib.Tests/Testing/TestTemporaryDirectoryTests.cs
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,24 @@ | ||
using FluentAssertions; | ||
using Kysect.CommonLib.Testing; | ||
|
||
namespace Kysect.CommonLib.Tests.Testing; | ||
|
||
public class TestTemporaryDirectoryTests | ||
{ | ||
/// <summary> | ||
/// We use this method during testing of git clone and get VERY LONG path. GitHub may fail with | ||
/// LibGit2Sharp.LibGit2SharpException : path too long: 'D:/a/GithubUtils/GithubUtils/Sources/artifacts/bin/Kysect.GithubUtils.Tests/release/TempDirectory/0d339f96-3146-42ff-84ee-d2534af2c84b/80ec70c9-6afa-413b-b3af-ac6ecc10aa8f/Sources/Kysect.GithubUtils/Contributions/ActivityProviders/GithubActivityProviderExtensions.cs | ||
/// </summary> | ||
[Fact] | ||
public void GetTemporaryDirectory_ReturnStringDoNotLong() | ||
{ | ||
var fileSystem = new System.IO.Abstractions.FileSystem(); | ||
string baseDirectoryPath = fileSystem.Path.GetFullPath("."); | ||
using var temporaryDirectory = new TestTemporaryDirectory(fileSystem); | ||
|
||
string directoryPath = temporaryDirectory.GetTemporaryDirectory(); | ||
int additionalLength = directoryPath.Length - baseDirectoryPath.Length; | ||
|
||
additionalLength.Should().BeLessThan(25); | ||
} | ||
} |