public void NoChanges() { TextDocument document = new TextDocument("initial text"); ITextSource snapshot1 = document.CreateSnapshot(); ITextSource snapshot2 = document.CreateSnapshot(); Assert.AreEqual(0, snapshot1.Version.CompareAge(snapshot2.Version)); Assert.AreEqual(0, snapshot1.Version.GetChangesTo(snapshot2.Version).Count()); Assert.AreEqual(document.Text, snapshot1.Text); Assert.AreEqual(document.Text, snapshot2.Text); }
public void NoChanges() { TextDocument document = new TextDocument("initial text"); ITextSource snapshot1 = document.CreateSnapshot(); ITextSource snapshot2 = document.CreateSnapshot(); Assert.AreEqual(0, snapshot1.Version.CompareAge(snapshot2.Version)); Assert.AreEqual(0, snapshot1.Version.GetChangesTo(snapshot2.Version).Count()); Assert.AreEqual(document.Text, snapshot1.Text); Assert.AreEqual(document.Text, snapshot2.Text); }
public void NoChanges() { TextDocument document = new TextDocument("initial text"); ChangeTrackingCheckpoint checkpoint1, checkpoint2; ITextSource snapshot1 = document.CreateSnapshot(out checkpoint1); ITextSource snapshot2 = document.CreateSnapshot(out checkpoint2); Assert.AreEqual(0, checkpoint1.CompareAge(checkpoint2)); Assert.AreEqual(0, checkpoint1.GetChangesTo(checkpoint2).Count()); Assert.AreEqual(document.Text, snapshot1.Text); Assert.AreEqual(document.Text, snapshot2.Text); }
public void NoChanges() { TextDocument document = new TextDocument("initial text"); ChangeTrackingCheckpoint checkpoint1, checkpoint2; ITextSource snapshot1 = document.CreateSnapshot(out checkpoint1); ITextSource snapshot2 = document.CreateSnapshot(out checkpoint2); Assert.AreEqual(0, checkpoint1.CompareAge(checkpoint2)); Assert.AreEqual(0, checkpoint1.GetChangesTo(checkpoint2).Count()); Assert.AreEqual(document.Text, snapshot1.Text); Assert.AreEqual(document.Text, snapshot2.Text); }
public void BackwardChanges() { TextDocument document = new TextDocument("initial text"); ITextSource snapshot1 = document.CreateSnapshot(); document.Replace(0, 7, "nw"); document.Insert(1, "e"); ITextSource snapshot2 = document.CreateSnapshot(); Assert.AreEqual(1, snapshot2.Version.CompareAge(snapshot1.Version)); TextChangeEventArgs[] arr = snapshot2.Version.GetChangesTo(snapshot1.Version).ToArray(); Assert.AreEqual(2, arr.Length); Assert.AreEqual("", arr[0].InsertedText.Text); Assert.AreEqual("initial", arr[1].InsertedText.Text); Assert.AreEqual("initial text", snapshot1.Text); Assert.AreEqual("new text", snapshot2.Text); }
public void BackwardChanges() { TextDocument document = new TextDocument("initial text"); ChangeTrackingCheckpoint checkpoint1, checkpoint2; ITextSource snapshot1 = document.CreateSnapshot(out checkpoint1); document.Replace(0, 7, "nw"); document.Insert(1, "e"); ITextSource snapshot2 = document.CreateSnapshot(out checkpoint2); Assert.AreEqual(1, checkpoint2.CompareAge(checkpoint1)); DocumentChangeEventArgs[] arr = checkpoint2.GetChangesTo(checkpoint1).ToArray(); Assert.AreEqual(2, arr.Length); Assert.AreEqual("", arr[0].InsertedText); Assert.AreEqual("initial", arr[1].InsertedText); Assert.AreEqual("initial text", snapshot1.Text); Assert.AreEqual("new text", snapshot2.Text); }
public void BackwardChanges() { TextDocument document = new TextDocument("initial text"); ITextSource snapshot1 = document.CreateSnapshot(); document.Replace(0, 7, "nw"); document.Insert(1, "e"); ITextSource snapshot2 = document.CreateSnapshot(); Assert.AreEqual(1, snapshot2.Version.CompareAge(snapshot1.Version)); TextChangeEventArgs[] arr = snapshot2.Version.GetChangesTo(snapshot1.Version).ToArray(); Assert.AreEqual(2, arr.Length); Assert.AreEqual("", arr[0].InsertedText.Text); Assert.AreEqual("initial", arr[1].InsertedText.Text); Assert.AreEqual("initial text", snapshot1.Text); Assert.AreEqual("new text", snapshot2.Text); }
public void BackwardChanges() { TextDocument document = new TextDocument("initial text"); ChangeTrackingCheckpoint checkpoint1, checkpoint2; ITextSource snapshot1 = document.CreateSnapshot(out checkpoint1); document.Replace(0, 7, "nw"); document.Insert(1, "e"); ITextSource snapshot2 = document.CreateSnapshot(out checkpoint2); Assert.AreEqual(1, checkpoint2.CompareAge(checkpoint1)); DocumentChangeEventArgs[] arr = checkpoint2.GetChangesTo(checkpoint1).ToArray(); Assert.AreEqual(2, arr.Length); Assert.AreEqual("", arr[0].InsertedText); Assert.AreEqual("initial", arr[1].InsertedText); Assert.AreEqual("initial text", snapshot1.Text); Assert.AreEqual("new text", snapshot2.Text); }