mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 18:07:21 +00:00
Upgraded to .NET 10 (#1147)
This commit is contained in:
1 parent
faae2951f7
commit
fc7399e81b
327 files changed
+3059
-3049
No files matched your search
@@ -20,11 +20,11 @@ public sealed class ContentStreamPageNumberTests
|
||||
{
|
||||
var processed = ContentStreamSseHandler.ProcessEvent(PdfEvent(7, "The mixing console is described here."));
|
||||
|
||||
Assert.Multiple(() =>
|
||||
using (Assert.EnterMultipleScope())
|
||||
{
|
||||
Assert.That(processed.Location.PageNumber, Is.EqualTo(7), "The page comes from the metadata of the event.");
|
||||
Assert.That(processed.Content, Does.Contain("# Page 7"), "The heading stays, because it is what tells the AI which page it reads.");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -49,11 +49,11 @@ public sealed class ContentStreamPageNumberTests
|
||||
Metadata = new ContentStreamTextMetadata(),
|
||||
});
|
||||
|
||||
Assert.Multiple(() =>
|
||||
using (Assert.EnterMultipleScope())
|
||||
{
|
||||
Assert.That(processed.Location.PageNumber, Is.Null, "Nothing is read out of the text, so a line which looks like a marker stays text.");
|
||||
Assert.That(processed.Content, Is.EqualTo("# Page 42\nStill nothing but the text of the document."), "The text itself is passed on untouched.");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks>
|
||||
@@ -71,12 +71,12 @@ public sealed class ContentStreamPageNumberTests
|
||||
var first = ContentStreamSseHandler.ProcessEvent(DocumentEvent(streamId, 1, "What the first page says."));
|
||||
var second = ContentStreamSseHandler.ProcessEvent(DocumentEvent(streamId, 2, "What the second page says."));
|
||||
|
||||
Assert.Multiple(() =>
|
||||
using (Assert.EnterMultipleScope())
|
||||
{
|
||||
Assert.That(first.Content, Is.Null, "The first page is still being buffered, so nothing is released yet.");
|
||||
Assert.That(second.Location.PageNumber, Is.EqualTo(1), "What is released here is the first page, so it carries page one.");
|
||||
Assert.That(second.Content, Does.Contain("What the first page says."), "The content released belongs to the page whose number is stated.");
|
||||
});
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -94,11 +94,11 @@ public sealed class ContentStreamPageNumberTests
|
||||
var remainder = ContentStreamSseHandler.Clear(streamId);
|
||||
|
||||
Assert.That(remainder, Is.Not.Null, "The reader always keeps its last page, so there is something left to release.");
|
||||
Assert.Multiple(() =>
|
||||
using (Assert.EnterMultipleScope())
|
||||
{
|
||||
Assert.That(remainder!.Value.PageNumber, Is.EqualTo(2), "The page kept back is the second one.");
|
||||
Assert.That(remainder.Value.Content, Does.Contain("What the second page says."), "The content released belongs to the page whose number is stated.");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks>
|
||||
@@ -115,11 +115,11 @@ public sealed class ContentStreamPageNumberTests
|
||||
Metadata = new ContentStreamPresentationMetadata { Presentation = new() { SlideNumber = 3 } },
|
||||
}, extractImages: false);
|
||||
|
||||
Assert.Multiple(() =>
|
||||
using (Assert.EnterMultipleScope())
|
||||
{
|
||||
Assert.That(processed.Location, Is.EqualTo(default(SourceLocation)), "A slide number is not a page number, and slides are left out while their order may be wrong.");
|
||||
Assert.That(processed.Content, Does.Contain("# Slide 3"), "The heading stays, so the AI still knows which slide it reads.");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -149,11 +149,11 @@ public sealed class ContentStreamPageNumberTests
|
||||
Metadata = new ContentStreamSpreadsheetMetadata { Spreadsheet = new() { SheetName = "Inventory", RowNumber = 0 } },
|
||||
});
|
||||
|
||||
Assert.Multiple(() =>
|
||||
using (Assert.EnterMultipleScope())
|
||||
{
|
||||
Assert.That(processed.Location, Is.EqualTo(new SourceLocation(SheetName: "Inventory")));
|
||||
Assert.That(processed.Content, Does.Contain("# Inventory"), "The heading still tells the AI which sheet it reads.");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
Reference in new issue
Block a user