public void SetUp() { _workingDirectory = PathUtility.CreateTemporaryPath(PathType.Folder); _testFolderPath = _workingDirectory.Join("foo".ToPathSpec().Value).Value; _testFolderPath.Create(PathType.Folder); _testFilePath = _testFolderPath.Join("bar.txt".ToPathSpec().Value).Value; _testFilePath.WriteAllText("Test123"); }
private void assertDirLink(PathSpec linkPath, PathSpec targetPath) { linkPath.CreateSymlinkTo(targetPath); linkPath.GetPathType().Should().Be(targetPath.GetPathType(), $"because the symlink {linkPath} should point to {targetPath}"); var symlinkedText = linkPath.Join("bar.txt".ToPathSpec().Value).Value.ReadAllText(); var text = targetPath.Join("bar.txt".ToPathSpec().Value).Value.ReadAllText(); symlinkedText.Should().Be(text, "Because the first file is linked to the second file"); linkPath.IsSymlink().Should().BeTrue(); linkPath.IsJunctionPoint().Should().BeFalse(); linkPath.GetSymlinkTarget().Value.ShouldBeEquivalentTo(targetPath); }