using AIStudio.Tools.DocumentSegments; namespace AIStudio.Tests.Tools.DocumentSegments; /// /// Checks what the results tell about the segments of a document. /// [TestFixture] public sealed class SegmentResultsTests { [Test] public void OnlyANewTextCountsAsChanged() { var results = new SegmentResults(new Dictionary { ["Teh <1>first sentence."] = SegmentOutcome.Transformed("The <1>first 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 { ["the end."] = SegmentOutcome.Transformed("The end."), }); Assert.That(results.CountChanged(), Is.EqualTo(1)); } }