Ejemplo n.º 1
0
        void GetRange_empty()
        {
            var list     = new InstructionList();
            var newList  = list.GetRange(0, 0);
            var expected = Array.Empty <Instruction>();

            Array.Equals(expected.Length, newList.Count);
            AssertEqual(expected, newList);
        }
Ejemplo n.º 2
0
        void GetRange_1()
        {
            var i        = GetInstructions();
            var expected = new Instruction[] {
                i[2],
            };
            var list    = new InstructionList(i);
            var newList = list.GetRange(2, 1);

            Array.Equals(expected.Length, newList.Count);
            AssertEqual(expected, newList);
        }
Ejemplo n.º 3
0
        void GetRange_2()
        {
            var i        = GetInstructions();
            var expected = new Instruction[] {
                i[5],
                i[6],
                i[7],
                i[8],
            };
            var list    = new InstructionList(i);
            var newList = list.GetRange(5, 4);

            Array.Equals(expected.Length, newList.Count);
            AssertEqual(expected, newList);
        }
Ejemplo n.º 4
0
        void GetRange_4()
        {
            var i        = GetInstructions();
            int end      = i.Length;
            var expected = new Instruction[] {
                i[end - 5],
                i[end - 4],
                i[end - 3],
                i[end - 2],
                i[end - 1],
            };
            var list    = new InstructionList(i);
            var newList = list.GetRange(end - 5, 5);

            Array.Equals(expected.Length, newList.Count);
            AssertEqual(expected, newList);
        }