nicTest.diff_match_patchTest.diff_xIndexTest C# (CSharp) Method

diff_xIndexTest() private method

private diff_xIndexTest ( ) : void
return void
    public void diff_xIndexTest() {
      diff_match_patchTest dmp = new diff_match_patchTest();
      // Translate a location in text1 to text2.
      List<Diff> diffs = new List<Diff> {
          new Diff(Operation.DELETE, "a"),
          new Diff(Operation.INSERT, "1234"),
          new Diff(Operation.EQUAL, "xyz")};
      Assert.AreEqual(5, dmp.diff_xIndex(diffs, 2), "diff_xIndex: Translation on equality.");

      diffs = new List<Diff> {
          new Diff(Operation.EQUAL, "a"),
          new Diff(Operation.DELETE, "1234"),
          new Diff(Operation.EQUAL, "xyz")};
      Assert.AreEqual(1, dmp.diff_xIndex(diffs, 3), "diff_xIndex: Translation on deletion.");
    }