Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ public override void SetCreationTimeUtc(string path, DateTime creationTimeUtc)
/// <inheritdoc />
public override void SetCurrentDirectory(string path)
{
currentDirectory = path;
currentDirectory = mockFileDataAccessor.Path.GetFullPath(path);
}

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1661,6 +1661,17 @@ public void MockDirectory_SetCurrentDirectory_ShouldChangeCurrentDirectory()
Assert.AreEqual(directory, fileSystem.Directory.GetCurrentDirectory());
}

[Test]
public void MockDirectory_SetCurrentDirectory_WithRelativePath_ShouldUseFullPath()
{
var fileSystem = new MockFileSystem();
fileSystem.Directory.SetCurrentDirectory(".");

var result = fileSystem.Directory.GetCurrentDirectory();

Assert.IsTrue(fileSystem.Path.IsPathRooted(result));
}

[Test]
public void MockDirectory_GetParent_ShouldThrowArgumentNullExceptionIfPathIsNull()
{
Expand Down