示例#1
0
    public void InsertRange()
    {
        LightList <int> ints = new LightList <int>();

        ints.Add(0);
        ints.Add(1);
        ints.Add(4);
        ints.Add(5);
        LightList <int> other = new LightList <int>();

        other.Add(2);
        other.Add(3);
        ints.InsertRange(2, other);
        Assert.AreEqual(6, ints.Count);
        for (int i = 0; i < ints.Count; i++)
        {
            Assert.AreEqual(i, ints[i]);
        }
    }
示例#2
0
    public void InsertRangeFromEndMinus1()
    {
        LightList <int> ints = new LightList <int>();

        ints.Add(0);
        ints.Add(1);
        ints.Add(4);
        ints.Add(5);
        LightList <int> other = new LightList <int>();

        other.Add(2);
        other.Add(3);
        ints.InsertRange(ints.Count - 1, other);
        Assert.AreEqual(6, ints.Count);
        Assert.AreEqual(0, ints[0]);
        Assert.AreEqual(1, ints[1]);
        Assert.AreEqual(4, ints[2]);
        Assert.AreEqual(2, ints[3]);
        Assert.AreEqual(3, ints[4]);
        Assert.AreEqual(5, ints[5]);
    }