Skip to content

Commit

Permalink
make CurrentWorkingDirectory static
Browse files Browse the repository at this point in the history
  • Loading branch information
sova committed Jun 20, 2024
1 parent 4d7bf3f commit c847c63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions TruePath.Tests/AbsolutePathTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public void CurrentWorkingDirectoryShouldReturnCorrectAbsolutePath()
var expectedPath = Directory.GetCurrentDirectory();

// Act
var actualPath = new AbsolutePath().CurrentWorkingDirectory;
var actualPath = AbsolutePath.CurrentWorkingDirectory;

// Assert
Assert.Equal(expectedPath, actualPath.Value);
Expand All @@ -23,7 +23,7 @@ public void CurrentWorkingDirectoryShouldReturnCorrectAbsolutePath()
public void CurrentWorkingDirectoryShouldBeAbsolute()
{
// Act
var path = new AbsolutePath().CurrentWorkingDirectory;
var path = AbsolutePath.CurrentWorkingDirectory;

// Assert
Assert.True(Path.IsPathRooted(path.Value));
Expand Down
2 changes: 1 addition & 1 deletion TruePath/AbsolutePath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public AbsolutePath(LocalPath localPath) : this(localPath.Value, checkAbsolutene
/// <value>
/// The current working directory.
/// </value>
public AbsolutePath CurrentWorkingDirectory => new(Environment.CurrentDirectory);
public static AbsolutePath CurrentWorkingDirectory => new(Environment.CurrentDirectory);

/// <summary>
/// Calculates the relative path from a base path to this path.
Expand Down

0 comments on commit c847c63

Please sign in to comment.