Esempio n. 1
0
        public void Remove_MultiInts_IndexChange()
        {
            // Arrange
            ListProperties <int> list = new ListProperties <int>()
            {
                0, 1, 2, 3, 4, 5, 6, 7
            };
            int expected = 7;

            // Act
            list.Remove(0);
            list.Remove(3);
            // Assert
            Assert.AreEqual(expected, list[5]);
        }
Esempio n. 2
0
        public void Remove_Objects_ThrowException()
        {
            // Arrange
            ListProperties <object> list = new ListProperties <object>();
            object notExpected           = list;

            // Act
            list.Add(list);
            list.Add(list);
            list.Add(list);
            list.Remove(list);
            list.Remove(list);
            list.Remove(list);
            // Assert
            Assert.AreNotEqual(notExpected, list[0]);
        }
Esempio n. 3
0
        public void Remove_Nothing_ResultEqualsFalse()
        {
            // Arrange
            ListProperties <object> list = new ListProperties <object>();
            // Act
            bool expected = false;
            bool remove   = list.Remove(list);

            // Assert
            Assert.AreEqual(expected, remove);
        }
Esempio n. 4
0
        public void Remove_EveryInts_ThrowException()
        {
            // Arrange
            ListProperties <int> list = new ListProperties <int>();

            list.Add(1);
            int notExpected = 1;

            // Act
            list.Remove(1);
            // Assert
            Assert.AreNotEqual(notExpected, list[0]);
        }
Esempio n. 5
0
        public void Remove_Object_ResultEqualsTrue()
        {
            // Arrange
            ListProperties <object> list = new ListProperties <object>();

            list.Add(list);
            list.Add(list);
            // Act
            bool expected = true;
            bool remove   = list.Remove(list);

            // Assert
            Assert.AreEqual(expected, remove);
        }
Esempio n. 6
0
        public void Remove_SingleObject_CountGoesDown()
        {
            // Arrange
            ListProperties <object> list = new ListProperties <object>();

            list.Add(list);
            list.Add(list);
            // Act
            int expected = 1;

            list.Remove(list);
            // Assert
            Assert.AreEqual(expected, list.Count);
        }
Esempio n. 7
0
        public void Remove_SingleInt_CountGoesDown()
        {
            // Arrange
            ListProperties <int> list = new ListProperties <int>();

            list.Add(1);
            list.Add(1);
            list.Add(1);
            list.Add(1);
            // Act
            int notExpected = list.Count;

            list.Remove(1);
            // Assert
            Assert.AreNotEqual(notExpected, list.Count);
        }
Esempio n. 8
0
        public void Remove_SingleString_IndexChange()
        {
            // Arrange
            ListProperties <string> list = new ListProperties <string>()
            {
                "One", "Two", "Three"
            };
            string one = "One";

            // Act

            list.Remove(one);
            string expected = "Three";

            // Assert
            Assert.AreEqual(expected, list[1]);
        }