public void TokenAdded1() { string before = @"class C{}"; string after = @"public class C{}"; var codeDiff = CompilationHelpers.GetDiff(before, after); Assert.AreEqual(1, codeDiff.GetAdded().Count()); Assert.AreEqual("public", codeDiff.GetAdded().First().After.ToString()); Assert.AreEqual(0, codeDiff.GetRemoved().Count()); Assert.AreEqual(0, codeDiff.GetModified().Count()); }
public void Identical2() { string after = @""; string before = @""; var codeDiff = CompilationHelpers.GetDiff(before, after); Assert.AreEqual(0, codeDiff.GetAdded().Count()); Assert.AreEqual(0, codeDiff.GetRemoved().Count()); Assert.AreEqual(0, codeDiff.GetModified().Count()); }
public void NodeDeletedEnd1() { string after = @"class C{}"; string before = @"class C{} class D{}"; var codeDiff = CompilationHelpers.GetDiff(before, after); Assert.AreEqual(0, codeDiff.GetAdded().Count()); Assert.AreEqual(1, codeDiff.GetRemoved().Count()); Assert.AreEqual("class D{}", codeDiff.GetRemoved().First().Before.ToString()); Assert.AreEqual(0, codeDiff.GetModified().Count()); }