public void DiffTest() { string source = "reegwvwvw"; var rule = new CutRuleWithFixedStart(source.Length, 3); List<string> cuts = DiffCutter.Cut(source, rule); Assert.AreEqual("ree", cuts[0]); Assert.AreEqual("reegwv", cuts[1]); Assert.AreEqual("reegwvwvw", cuts[2]); }
public void CutRuleTest() { int length = 12; int step = 3; var rule = new CutRuleWithFixedStart(length, step); CutRuleIterator iterator = rule.GetIterator(); for (int i = step; i <= length; i += step) { iterator.Next(); Assert.AreEqual(0, iterator.GetStartPosition()); Assert.AreEqual(i, iterator.GetEndPosition()); } }