public void subsequenceTests() { var src = new[] {1, 2, 3, 4}; var search = new[] {2, 3}; var r = src.findSubsequenceIndex(search); Assert.That(r, Is.EqualTo(1)); }
public void notFound() { var src = new[] { 1, 2, 2, 3, 4 }; var search = new[] { 3, 2 }; var r = src.findSubsequenceIndex(search); Assert.That(r, Is.EqualTo(null)); }
public void exactEnd() { var src = new[] { 1, 2, 2, 3, 4 }; var search = new[] { 3, 4 }; var r = src.findSubsequenceIndex(search); Assert.That(r, Is.EqualTo(3)); }
public void atTheBeginning() { var src = new[] { 1, 2, 2, 3, 4 }; var search = new[] { 1, 2 }; var r = src.findSubsequenceIndex(search); Assert.That(r, Is.EqualTo(0)); }
public void subsequenceSimilarBeginning() { var src = new[] { 1, 2, 2, 3, 4 }; var search = new[] { 2, 3 }; var r = src.findSubsequenceIndex(search); Assert.That(r, Is.EqualTo(2)); }