コード例 #1
0
        public void Intersection_ReturnsFalseWhenTheTwoListDontIntersect()
        {
            var nodes = new LinkedListNode <int>[]
            {
                new LinkedListNode <int>(0),
                new LinkedListNode <int>(1),
                new LinkedListNode <int>(2),

                new LinkedListNode <int>(3),
                new LinkedListNode <int>(4),
                new LinkedListNode <int>(5),
            };

            // First list.
            INTERSECTING_LISTS[0].Append(nodes[0]);
            INTERSECTING_LISTS[0].Append(nodes[1]);
            INTERSECTING_LISTS[0].Append(nodes[2]);

            // Second list.
            INTERSECTING_LISTS[1].Append(nodes[3]);
            INTERSECTING_LISTS[1].Append(nodes[4]);
            INTERSECTING_LISTS[1].Append(nodes[5]);

            bool result = Problem_07.Intersection(NON_INTERSECTING_LISTS[0], NON_INTERSECTING_LISTS[1]);

            Assert.IsFalse(result);
        }
コード例 #2
0
 public void RotateMatrix_ReturnsRotatedMatrix()
 {
     Problem_07.RotateMatrix(MATRIX);
     CollectionAssert.AreEqual(ROTATED_MATRIX, MATRIX);
 }