Agents\AgentInstructionsFileTests.cs (28)
34await File.WriteAllTextAsync(GetFilePath(workspace), existing);
50await File.WriteAllTextAsync(GetFilePath(workspace), $"# Rules\n\n{oldSection}\n\n## More rules\nKeep tests green.\n");
69TestSymlinkHelper.TryCreateSymlink(GetFilePath(workspace), target, isDirectory: false);
74Assert.Equal(target, new FileInfo(GetFilePath(workspace)).LinkTarget);
123TestSymlinkHelper.TryCreateSymlink(GetFilePath(workspace), "CLAUDE.md", isDirectory: false);
128Assert.Equal("CLAUDE.md", new FileInfo(GetFilePath(workspace)).LinkTarget);
141await File.WriteAllTextAsync(GetFilePath(workspace), existing);
157await File.WriteAllTextAsync(GetFilePath(workspace), $"# Rules\n\n{earlierText}\nKeep this team rule.\n\n{AgentInstructionsFile.CreateSection("old.cs", false, "\n")}\n");
177await File.WriteAllTextAsync(GetFilePath(workspace), existing);
198await File.WriteAllTextAsync(GetFilePath(workspace), existing);
211await File.WriteAllTextAsync(GetFilePath(workspace), existing);
226await File.WriteAllTextAsync(GetFilePath(workspace), $"# Rules\n\n{AgentInstructionsFile.CreateSection("old.cs", false, "\n")}\n{after}");
242await File.WriteAllTextAsync(GetFilePath(workspace), existing);
256await File.WriteAllTextAsync(GetFilePath(workspace), $"# Rules\n\n{oldSection} Keep this team rule.\nMore rules.\n");
272await File.WriteAllTextAsync(GetFilePath(workspace), existing);
286await File.WriteAllTextAsync(GetFilePath(workspace), existing);
300await File.WriteAllTextAsync(GetFilePath(workspace), existing);
314await File.WriteAllTextAsync(GetFilePath(workspace), existing);
329await File.WriteAllTextAsync(GetFilePath(workspace), "# Rules\n\n<!-- aspire:begin-->\nOld section.\n<!-- aspire:end -->\nMore rules.\n");
397await File.WriteAllBytesAsync(GetFilePath(workspace), [.. encoding.Preamble, .. encoding.GetBytes("# R\u00E8gles\n")]);
403Assert.Equal(expected, await File.ReadAllBytesAsync(GetFilePath(workspace)));
412await File.WriteAllBytesAsync(GetFilePath(workspace), [.. encoding.Preamble, .. encoding.GetBytes("# R\u00E8gles\r\n")]);
418Assert.Equal(expected, await File.ReadAllBytesAsync(GetFilePath(workspace)));
428await File.WriteAllBytesAsync(GetFilePath(workspace), original);
433Assert.Equal(original, await File.ReadAllBytesAsync(GetFilePath(workspace)));
446await File.WriteAllBytesAsync(GetFilePath(workspace), original);
451Assert.Equal(original, await File.ReadAllBytesAsync(GetFilePath(workspace)));
458await File.ReadAllTextAsync(GetFilePath(workspace));