public void OwnsChangeReturnsFalseIfChangeIsInsertionAtSpanEndAndCanGrowIsFalse() { // Arrange Span span = new CodeSpan(new SourceLocation(42, 0, 42), "FooBarBaz", hidden: false, acceptedCharacters: AcceptedCharacters.None); TextChange change = new TextChange(51, 0, new StringTextBuffer("BooBarBaz"), 3, new StringTextBuffer("Foo")); // Act/Assert Assert.IsFalse(span.OwnsChange(change)); }
public void OwnsChangeReturnsFalseIfChangeIsReplacementOrDeleteAtSpanEnd() { // Arrange Span span = new CodeSpan(new SourceLocation(42, 0, 42), "FooBarBaz"); TextChange change = new TextChange(51, 2, new StringTextBuffer("BooBarBaz"), 3, new StringTextBuffer("Foo")); // Act/Assert Assert.IsFalse(span.OwnsChange(change)); }
public void OwnsChangeReturnsTrueIfChangeIsInsertionAtSpanEndAndCanGrowIsTrue() { // Arrange Span span = new CodeSpan(new SourceLocation(42, 0, 42), "FooBarBaz"); TextChange change = new TextChange(51, 0, new StringTextBuffer("BooBarBaz"), 3, new StringTextBuffer("Foo")); // Act/Assert Assert.IsTrue(span.OwnsChange(change)); }
public void OwnsChangeReturnsFalseIfChangeStartsAfterSpanEnds() { // Arrange Span span = new CodeSpan(new SourceLocation(42, 0, 42), "FooBarBaz"); TextChange change = new TextChange(52, 3, new StringTextBuffer("BooBarBaz"), 3, new StringTextBuffer("Foo")); // Act/Assert Assert.IsFalse(span.OwnsChange(change)); }
public void OwnsChangeReturnsTrueIfSpanContentEntirelyContainsOldSpan() { // Arrange Span span = new CodeSpan(new SourceLocation(42, 0, 42), "FooBarBaz"); TextChange change = new TextChange(45, 3, new StringTextBuffer("BooBarBaz"), 3, new StringTextBuffer("Foo")); // Act/Assert Assert.IsTrue(span.OwnsChange(change)); }
public void OwnsChangeReturnsFalseIfOldSpanOverlapsNeighbouringSpan() { // Arrange Span span = new CodeSpan(new SourceLocation(42, 0, 42), "FooBarBaz"); TextChange change = new TextChange(44, 50, new StringTextBuffer("BooBarBaz"), 3, new StringTextBuffer("Foo")); // Act/Assert Assert.IsFalse(span.OwnsChange(change)); }