Esempio n. 1
0
        public void Add_Ints_IncreaseCount()
        {
            // Arrange
            ListProperties <int> list = new ListProperties <int>();

            // Act
            list.Add(1);
            list.Add(2);
            list.Add(3);
            int result = 3;

            // Assert
            Assert.AreEqual(result, list.Count);
        }
Esempio n. 2
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. 3
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. 4
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. 5
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. 6
0
        public void Add_MultiInts_ImprovedArray()
        {
            // Arrange
            ListProperties <int> list     = new ListProperties <int>();
            ListProperties <int> expected = new ListProperties <int>()
            {
                1, 2, 3
            };

            // Act

            list.Add(1);
            list.Add(2);
            list.Add(3);
            Assert.AreEqual(list[0], expected[0]);
        }
Esempio n. 7
0
        public void Add_MultiStrings_ImprovedArray()
        {
            // Arrange
            ListProperties <string> list     = new ListProperties <string>();
            ListProperties <string> expected = new ListProperties <string>()
            {
                "One", "Two", "Three"
            };

            // Act
            list.Add("One");
            list.Add("Two");
            list.Add("Three");

            // Assert
            Assert.AreEqual(expected[0], list[0]);
        }
Esempio n. 8
0
        public void Add_SingleInt_ArrayLoads()
        {
            // Arrange
            ListProperties <int> list = new ListProperties <int>();

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

            // Assert
            Assert.AreEqual(expected, list[0]);
        }
Esempio n. 9
0
        public void ZipListProperties_ListPropertiesobject_ListPropertiesZipped()
        {
            //Arrange
            ListProperties <Objects> objectsA     = new ListProperties <Objects>();
            ListProperties <Objects> objectsB     = new ListProperties <Objects>();
            ListProperties <Objects> actualResult = new ListProperties <Objects>();
            Objects ObjectA = new Objects();
            Objects ObjectB = new Objects();

            objectsA.Add(ObjectA);
            objectsB.Add(ObjectB);
            ListProperties <Objects> expectedResult = new ListProperties <Objects>();

            expectedResult.Add(ObjectA);
            expectedResult.Add(ObjectB);

            //Act
            actualResult = objectsA.Zip(objectsB);

            //Assert
            Assert.AreEqual(expectedResult.ToString(), actualResult.ToString());
        }
Esempio n. 10
0
        public void ZipListProperties_ListPropertiesint_ListPropertiesZipped()
        {
            //Arrange
            ListProperties <int> expectedResult = new ListProperties <int>()
            {
                1, 2, 3, 4
            };
            ListProperties <int> numbers      = new ListProperties <int>();
            ListProperties <int> moreNumbers  = new ListProperties <int>();
            ListProperties <int> actualResult = new ListProperties <int>();

            numbers.Add(1);
            numbers.Add(3);
            moreNumbers.Add(2);
            moreNumbers.Add(4);

            //Act
            actualResult = numbers.Zip(moreNumbers);

            //Assert
            Assert.AreEqual(expectedResult.ToString(), actualResult.ToString());
        }
Esempio n. 11
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. 12
0
        public void Add_SingleInt_IncreaseCount()
        {
            // Arrange
            ListProperties <int> list     = new ListProperties <int>();
            ListProperties <int> expected = new ListProperties <int>()
            {
                1
            };

            // Act
            list.Add(1);
            // Assert
            Assert.AreEqual(expected.Count, list.Count);
        }
Esempio n. 13
0
        public void Add_Objects_ImproveArray()
        {
            // Arrange
            ListProperties <object> list     = new ListProperties <object>();
            ListProperties <object> expected = new ListProperties <object>()
            {
                1
            };

            // Act
            list.Add(1);
            int[] result = new int[] { 1 };
            // Assert
            Assert.AreEqual(expected.Count, list.Count);
        }
Esempio n. 14
0
        public void ZipListProperties_ListPropertiesString_ListPropertiesZipped()
        {
            //Arrange
            ListProperties <string> expectedResult = new ListProperties <string>();

            expectedResult.Add("A");
            expectedResult.Add("B");
            expectedResult.Add("C");
            expectedResult.Add("D");
            ListProperties <string> stringsA     = new ListProperties <string>();
            ListProperties <string> stringsB     = new ListProperties <string>();
            ListProperties <string> actualResult = new ListProperties <string>();

            stringsA.Add("A");
            stringsA.Add("C");
            stringsB.Add("B");
            stringsB.Add("D");

            //Act
            actualResult = stringsA.Zip(stringsB);

            //Assert
            Assert.AreEqual(expectedResult.ToString(), actualResult.ToString());
        }
Esempio n. 15
0
        public void Minus_Objects_CountDecreases()
        {
            // Arrange
            ListProperties <object> list = new ListProperties <object>()
            {
            };

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

            list = list - list;
            // Assert
            Assert.AreEqual(expected, list.Count);
        }
Esempio n. 16
0
        public void Add_MultiObjects_SizeExpands()
        {
            // Arrange
            ListProperties <object> list = new ListProperties <object>();
            // Act
            object obj = new object();

            list.Add(obj);
            list.Add(obj);
            list.Add(obj);
            list.Add(obj);
            list.Add(obj);
            list.Add(obj);
            list.Add(obj);
            list.Add(obj);
            list.Add(obj);
            list.Add(obj);
            list.Add(obj);
            list.Add(obj);
            list.Add(obj);
            list.Add(obj);
            list.Add(obj);
            list.Add(obj);
            list.Add(obj);
            list.Add(obj);
            list.Add(obj);
            int expected = 19;

            // Assert
            Assert.AreEqual(expected, list.Count);
        }