Ejemplo n.º 1
0
        public void ToString_NoItemsInList_EmptyString()
        {
            // Arrange
            string      expected = "{  }";
            JList <int> j        = new JList <int>();

            // Act
            string actual = j.ToString();

            // Assert
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        public void Sort_ListOfUnsortedValues_StringOutputInSortedOrder()
        {
            // Arrange
            var j = new JList <int>()
            {
                5, 3, 7, 2, 6, 4, 1
            };

            // Act
            j = JList <int> .Sort <int>(j);

            // Assert
            string expected = "{ 1, 2, 3, 4, 5, 6, 7 }";
            string actual   = j.ToString();

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void ToString_MultipleItemsInList_OutputCSVString()
        {
            // Arrange
            int         itemsToAdd = 10;
            string      expected   = "{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }";
            JList <int> j          = new JList <int>();

            for (int i = 0; i < itemsToAdd; i++)
            {
                j.Add(i);
            }

            // Act
            string actual = j.ToString();

            // Assert
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 4
0
        public void Zip_TwoEqualCountLists_CheckValues()
        {
            // Arrange
            var odd = new JList <int>()
            {
                1, 3, 5, 7
            };
            var even = new JList <int>()
            {
                2, 4, 6, 8
            };
            var numbers = new JList <int>();

            // Act
            numbers = JList <int> .Zip(odd, even);

            // Assert
            string expected = "{ 1, 2, 3, 4, 5, 6, 7, 8 }";
            string actual   = numbers.ToString();

            Assert.AreEqual(expected, actual);
        }