コード例 #1
0
        public void MixTest(int[] a, int[] b, bool[] c, int[] expected)
        {
            var listA   = new VSArray <int>(a);
            var listB   = new VSArray <int>(b);
            var indices = new VSArray <bool>(c);

            // Create new list, don't modify original
            var list2 = listA.GetMix(listB, indices);

            Assert.That(listA, Is.EqualTo(a.ToVSArray()));
            Assert.That(listB, Is.EqualTo(b.ToVSArray()));
            Assert.That(list2, Is.EqualTo(expected.ToVSArray()));

            // Modify original (in-place)
            listA.Mix(listB, indices);
            Assert.That(listA, Is.EqualTo(expected.ToVSArray()));
            Assert.That(listA, Is.EqualTo(list2));
        }