예제 #1
0
        public void GetIndexOutOfBounds()
        {
            var f = new PhysicalFile()
            {
                Sourcecode = "a\nabc\na"
            };
            Position p = new Position(2, 2);

            Assert.Throws <IndexOutOfRangeException>(() => f.GetIndex(p));
        }
예제 #2
0
        public void GetNewLinesAsTarget_rn_hitr()
        {
            var f = new PhysicalFile()
            {
                Sourcecode = "a\r\nabc\na"
            };
            Position p      = new Position(0, 1);
            int      actual = f.GetIndex(p);

            Assert.AreEqual(1, actual);
        }
예제 #3
0
        public void GetIndexFirstLine2()
        {
            var f = new PhysicalFile()
            {
                Sourcecode = "aX\nabc\na"
            };
            Position p      = new Position(0, 1);
            int      actual = f.GetIndex(p);

            Assert.AreEqual(1, actual);
        }
예제 #4
0
        public void GetIndexNormalSlashR()
        {
            var f = new PhysicalFile()
            {
                Sourcecode = "a\r\naXc\na"
            };
            Position p      = new Position(1, 1);
            int      actual = f.GetIndex(p);

            Assert.AreEqual(4, actual);
        }
예제 #5
0
        public void Pos_0_0()
        {
            Position p = new Position(0, 0);
            var      r = f.GetIndex(p);

            Assert.AreEqual(0, r);
        }