コード例 #1
0
        public void SortElementsTest(int[] source, int[] expected)
        {
            var list1 = new VSArray <int>(source);

            // Create new list, don't modify original
            var list2 = list1.GetSortElements();

            Assert.That(list1, Is.EqualTo(source.ToVSArray()));
            Assert.That(list2, Is.EqualTo(expected.ToVSArray()));

            // Modify original (in-place)
            list1.SortElements();
            Assert.That(list1, Is.EqualTo(expected.ToList()));
            Assert.That(list1, Is.EqualTo(list2));
        }