public void Basic() { _builder.EnsureDirectory(); _builder.CreateDirectory("dir", TestFile.DefaultLastWrite); File.WriteAllText(_builder.NewFilePath("dir/file", TestFile.DefaultLastWrite), TestFile.DefaultContents); _builder.QueueHardlink("dir/hardlink", "dir/file"); File.WriteAllText(_builder.NewFilePath("dir/executable", TestFile.DefaultLastWrite, executable: true), TestFile.DefaultContents); _builder.CreateSymlink("dir/symlink", "target"); _builder.CompletePending(); new TestRoot { new TestDirectory("dir") { new TestFile("file"), new TestFile("hardlink"), new TestFile("executable") { IsExecutable = true }, new TestSymlink("symlink", "target") } }.Verify(_tempDir); }
/// <inheritdoc/> protected override void HandleSymlink(FileSystemInfo symlink, string target) { if (symlink == null) { throw new ArgumentNullException(nameof(symlink)); } if (string.IsNullOrEmpty(target)) { throw new ArgumentNullException(nameof(target)); } if (symlink.Name == SourceFileName) { DirectoryBuilder.CreateSymlink(TargetFileName, target); } }