Added whole documents to the Translation, Grammar & Spelling, and Rewrite & Improve assistants (#1179)

Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
Sabrina-devopsandThorsten Sommer authored and GitHub committed 2026-11-28 20:27:23 +01:00
1 parent f7666861f1
commit 918572c158
150 files changed
+12850 -302

No files matched your search

@@ -0,0 +1,39 @@
using AIStudio.Tools.DocumentSegments;
namespace AIStudio.Tests.Tools.DocumentSegments;
/// <summary>
/// Checks what the results tell about the segments of a document.
/// </summary>
[TestFixture]
public sealed class SegmentResultsTests
{
[Test]
public void OnlyANewTextCountsAsChanged()
{
var results = new SegmentResults(new Dictionary<string, SegmentOutcome>
{
["Teh <1>first</1> sentence."] = SegmentOutcome.Transformed("The <1>first</1> sentence."),
["The second sentence."] = SegmentOutcome.Transformed("The second sentence."),
["A filtered sentence."] = SegmentOutcome.FILTERED,
["A failed sentence."] = SegmentOutcome.FAILED,
});
using (Assert.EnterMultipleScope())
{
Assert.That(results.CountOf(SegmentStatus.TRANSFORMED), Is.EqualTo(2), "A model worked on both sentences.");
Assert.That(results.CountChanged(), Is.EqualTo(1), "A sentence returned as it was stays unchanged.");
}
}
[Test]
public void ADifferenceInCaseCountsAsChanged()
{
var results = new SegmentResults(new Dictionary<string, SegmentOutcome>
{
["the end."] = SegmentOutcome.Transformed("The end."),
});
Assert.That(results.CountChanged(), Is.EqualTo(1));
}
}