Beispiel #1
0
        public void AddItemRange_Fact()
        {
            var list = new StringList();

            list.ShouldHaveState(0, 0);
            list.AddRange("Hello", "Good-bye");
            list.ShouldHaveState(2, 2, "Hello", "Good-bye");
        }
Beispiel #2
0
        public void IndexedItem_Fact()
        {
            var list = new StringList("a", "b", "c");

            list.ShouldHaveState(3, 0, "a", "b", "c");
            list[1].ShouldEqual("b");
            list[1] = "#";
            list.ShouldHaveState(3, 1, "a", "#", "c");
        }
Beispiel #3
0
        public void InsertItemRange_Fact()
        {
            var list = new StringList();

            list.InsertRange(0, "world");
            list.ShouldHaveState(1, 1, "world");
            list.InsertRange(0, "hello");
            list.ShouldHaveState(2, 2, "hello", "world");
            list.InsertRange(1, "micro");
            list.ShouldHaveState(3, 3, "hello", "micro", "world");
            list.InsertRange(0, "super", "awesome", "fun", "time");
            list.ShouldHaveState(7, 7, "super", "awesome", "fun", "time", "hello", "micro", "world");
        }
Beispiel #4
0
        public void InsertItem_Fact()
        {
            var list = new StringList();

            list.Insert(0, "hello");
            list.ShouldHaveState(1, 1, "hello");
            list.Insert(1, "world");
            list.ShouldHaveState(2, 2, "hello", "world");
            list.Insert(1, "micro");
            list.ShouldHaveState(3, 3, "hello", "micro", "world");
            list.Insert(0, "awesome:");
            list.ShouldHaveState(4, 4, "awesome:", "hello", "micro", "world");
        }