private void assertFileLink(PathSpec linkPath, PathSpec targetPath) { linkPath.CreateSymlinkTo(targetPath); var symlinkedText = linkPath.ReadAllText(); var text = targetPath.ReadAllText(); symlinkedText.Should().Be(text, "Because the first file is linked to the second file"); linkPath.IsSymlink().Should().BeTrue(); }
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); }