示例#1
0
        public void ToString_EmptyList_ReturnEmptyString()
        {
            // Arrange
            ListProperties <string> list = new ListProperties <string>();
            // Act
            string expected = "";
            string result   = list.ToString();

            // Assert
            Assert.AreEqual(expected, result);
        }
示例#2
0
        public void ToString_Bools_ReturnOneString()
        {
            // Arrange
            ListProperties <bool> list = new ListProperties <bool>()
            {
                true, false, true
            };
            // Act
            string expected = "TrueFalseTrue";
            string result   = list.ToString();

            // Assert
            Assert.AreEqual(expected, result);
        }
示例#3
0
        public void ToString_MultiInts_ReturnOneString()
        {
            // Arrange
            ListProperties <int> list = new ListProperties <int>()
            {
                1, 1, 4
            };
            // Act
            string expected = "114";
            string result   = list.ToString();

            // Assert
            Assert.AreEqual(expected, result);
        }
示例#4
0
        public void ToString_ThreeStrings_ReturnOneString()
        {
            // Arrange
            ListProperties <string> list = new ListProperties <string>()
            {
                "One", "Two", "Three"
            };
            // Act
            string expected = "OneTwoThree";
            string result   = list.ToString();

            // Assert
            Assert.AreEqual(expected, result);
        }
示例#5
0
        public void Sort_Strings_ReturnOrderedList()
        {
            // Arrange
            ListProperties <string> list = new ListProperties <string>()
            {
                "The", "He", "A", "Hat"
            };

            // Act
            list.Sort();
            string expected = "AHatHeThe";

            // Assert
            Assert.AreEqual(expected, list.ToString());
        }
示例#6
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());
        }
示例#7
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());
        }
示例#8
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());
        }