mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-12-06 05:31:36 +00:00
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:
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));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user