public void GetCharOrDefault1() { Create("foo", "bar"); var point = _textBuffer.GetLine(0).Start; Assert.AreEqual('f', SnapshotPointUtil.GetCharOrDefault(point, 'g')); }
public void GetCharOrDefault2() { Create("foo", "bar"); var endPoint = new SnapshotPoint(_textBuffer.CurrentSnapshot, _textBuffer.CurrentSnapshot.Length); var didSee = false; try { var notUsed = endPoint.GetChar(); } catch (ArgumentException) { didSee = true; } Assert.IsTrue(didSee); Assert.AreEqual('f', SnapshotPointUtil.GetCharOrDefault(endPoint, 'f')); }