コード例 #1
0
ファイル: SnapshotPointUtilTest.cs プロジェクト: sh54/VsVim
        public void GetCharOrDefault1()
        {
            Create("foo", "bar");
            var point = _textBuffer.GetLine(0).Start;

            Assert.AreEqual('f', SnapshotPointUtil.GetCharOrDefault(point, 'g'));
        }
コード例 #2
0
ファイル: SnapshotPointUtilTest.cs プロジェクト: sh54/VsVim
        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'));
        }