public void Test3Frags() { FieldFragList ffl = this.ffl("a c", "a b b b b b b b b b b b a b a b b b b b c a a b b"); SimpleFragmentsBuilder sfb = new SimpleFragmentsBuilder(); String[] f = sfb.CreateFragments(reader, 0, F, ffl, 3); Assert.AreEqual(3, f.Length); Assert.AreEqual("<b>a</b> b b b b b b b b b ", f[0]); Assert.AreEqual("b b <b>a</b> b <b>a</b> b b b b b ", f[1]); Assert.AreEqual("<b>c</b> <b>a</b> <b>a</b> b b", f[2]); }
public void Test2Frags() { FieldFragList ffl = this.ffl("a", "a b b b b b b b b b b b a b a b"); SimpleFragmentsBuilder sfb = new SimpleFragmentsBuilder(); String[] f = sfb.CreateFragments(reader, 0, F, ffl, 3); // 3 snippets requested, but should be 2 Assert.AreEqual(2, f.Length); Assert.AreEqual("<b>a</b> b b b b b b b b b ", f[0]); Assert.AreEqual("b b <b>a</b> b <b>a</b> b", f[1]); }