Skip to content

Commit

Permalink
fixed test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
heejaechang committed Feb 15, 2018
1 parent 97f9a1c commit 8700a69
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public void GetBufferTextFromTextContainerDoesNotThrow()
var textSnapshotMock = new Mock<VisualStudio.Text.ITextSnapshot2>();
var bufferMock = new Mock<VisualStudio.Text.ITextBuffer>();

textSnapshotMock.Setup(s => s.TextImage).Returns(textImageMock.Object);
textSnapshotMock.SetupGet(s => s.TextImage).Returns(textImageMock.Object);
textSnapshotMock.SetupGet(s => s.TextBuffer).Returns(bufferMock.Object);
bufferMock.SetupGet(x => x.CurrentSnapshot).Returns(textSnapshotMock.Object);
bufferMock.SetupGet(x => x.Properties).Returns(new VisualStudio.Utilities.PropertyCollection());

Expand Down
8 changes: 6 additions & 2 deletions src/EditorFeatures/Test/TextEditor/TryGetDocumentTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,14 @@ public void EmptyTextChanges()
Assert.True(buffer.CurrentSnapshot.Version.ReiteratedVersionNumber == 1);

var newText = buffer.CurrentSnapshot.AsText();
Assert.Same(text, newText);

// different buffer snapshot should never return same roslyn text snapshot
Assert.NotSame(text, newText);

Document newDocument = newText.GetRelatedDocumentsWithChanges().First();
Assert.Same(document, newDocument);

// different text snapshot never gives back same roslyn snapshot
Assert.NotSame(document, newDocument);
}
}
}
Expand Down

0 comments on commit 8700a69

Please sign in to comment.