Beispiel #1
0
        public void InsertAndResize()
        {
            var sut    = new ObjectArray();
            var intArr = new int[] { 2, 3, 4 };

            sut.Add(0);
            sut.Add(true);
            sut.Add(3.4647);
            sut.Add("string");
            sut.Add(intArr);
            sut.Add(6);
            sut.Add(0);
            sut.Add(8);
            sut.Add(9);
            sut.Add(10);
            sut.Insert(3, true);
            Assert.Equal(4, sut.IndexOf("string"));
        }
Beispiel #2
0
        public void IndexOfElement()
        {
            var intArr = new int[] { 2, 3, 4 };
            var sut    = new ObjectArray();

            sut.Add(0);
            sut.Add(true);
            sut.Add(3.4647);
            sut.Add("string");
            sut.Add(intArr);
            sut.Add(6);
            sut.Add(0);
            sut.Add(8);
            sut.Add(9);
            sut.Add(10);

            Assert.Equal(3, sut.IndexOf("string"));
        }
Beispiel #3
0
        public void IndexOfElement()
        {
            int    val      = 9;
            object objValue = val;
            var    sut      = new ObjectArray();
            var    intArr   = new int[] { 2, 3, 4 };

            sut.Add(0);
            sut.Add(true);
            sut.Add(3.4647);
            sut.Add("string");
            sut.Add(intArr);
            sut.Add(6);
            sut.Add(0);
            sut.Add(8);
            sut.Add(9);
            sut.Add(10);
            sut.Insert(1, objValue);
            Assert.Equal(1, sut.IndexOf(objValue));
        }
Beispiel #4
0
        public void IndexOfElementNotFound()
        {
            string str    = "abc";
            object s      = str;
            var    intArr = new int[] { 2, 3, 4 };
            var    sut    = new ObjectArray();

            sut.Add(0);
            sut.Add(true);
            sut.Add(3.4647);
            sut.Add("string");
            sut.Add(intArr);
            sut.Add(6);
            sut.Add(0);
            sut.Add(8);
            sut.Add(9);
            sut.Add(10);

            Assert.Equal(-1, sut.IndexOf(s));
        }