Public Access
66 lines
2.8 KiB
C#
66 lines
2.8 KiB
C#
using MeetingAssistant.MeetingNotes;
|
|
using MeetingAssistant.Recording;
|
|
|
|
namespace MeetingAssistant.Tests;
|
|
|
|
public sealed class MeetingRunArtifactCleanerTests
|
|
{
|
|
[Fact]
|
|
public async Task DeleteRunArtifactsDeletesGeneratedScreenshotAttachmentsOnly()
|
|
{
|
|
var root = Path.Combine(Path.GetTempPath(), "meeting-assistant-tests", Guid.NewGuid().ToString("N"));
|
|
var artifacts = new MeetingSessionArtifacts(
|
|
Path.Combine(root, "Notes", "meeting.md"),
|
|
Path.Combine(root, "Transcripts", "transcript.md"),
|
|
Path.Combine(root, "Context", "context.md"),
|
|
Path.Combine(root, "Summaries", "summary.md"));
|
|
var attachments = Path.Combine(Path.GetDirectoryName(artifacts.AssistantContextPath)!, "Attachments");
|
|
Directory.CreateDirectory(attachments);
|
|
Directory.CreateDirectory(Path.GetDirectoryName(artifacts.MeetingNotePath)!);
|
|
Directory.CreateDirectory(Path.GetDirectoryName(artifacts.TranscriptPath)!);
|
|
Directory.CreateDirectory(Path.GetDirectoryName(artifacts.SummaryPath)!);
|
|
|
|
var generatedScreenshot = Path.Combine(attachments, "20260527-093135-123-000010.png");
|
|
var generatedCrop = Path.Combine(attachments, "20260527-093135-123-000010-cropped.png");
|
|
var manualAttachment = Path.Combine(attachments, "manual-reference.png");
|
|
var nonImageLinkedFile = Path.Combine(attachments, "20260527-093135-123-000011.png");
|
|
foreach (var file in new[]
|
|
{
|
|
artifacts.MeetingNotePath,
|
|
artifacts.TranscriptPath,
|
|
artifacts.SummaryPath,
|
|
generatedScreenshot,
|
|
generatedCrop,
|
|
manualAttachment,
|
|
nonImageLinkedFile
|
|
})
|
|
{
|
|
await File.WriteAllTextAsync(file, "content");
|
|
}
|
|
|
|
await File.WriteAllTextAsync(
|
|
artifacts.AssistantContextPath,
|
|
"""
|
|

|
|

|
|

|
|
[Reference](Attachments/20260527-093135-123-000011.png)
|
|
""");
|
|
var cleaner = new MeetingRunArtifactCleaner();
|
|
|
|
await cleaner.DeleteRunArtifactsAsync(
|
|
artifacts,
|
|
new MeetingAssistantOptions(),
|
|
CancellationToken.None);
|
|
|
|
Assert.False(File.Exists(artifacts.MeetingNotePath));
|
|
Assert.False(File.Exists(artifacts.TranscriptPath));
|
|
Assert.False(File.Exists(artifacts.AssistantContextPath));
|
|
Assert.False(File.Exists(artifacts.SummaryPath));
|
|
Assert.False(File.Exists(generatedScreenshot));
|
|
Assert.False(File.Exists(generatedCrop));
|
|
Assert.True(File.Exists(manualAttachment));
|
|
Assert.True(File.Exists(nonImageLinkedFile));
|
|
}
|
|
}
|