コード例 #1
0
        public void RemoveDuplicatesTest_EmptyInput()
        {
            var solution = new _080_RemoveDuplicatesFromSortedArray2();
            var result = solution.RemoveDuplicates(new int[] { });

            Assert.AreEqual(0, result);
        }
コード例 #2
0
        public void RemoveDuplicatesTest_EmptyInput()
        {
            var solution = new _080_RemoveDuplicatesFromSortedArray2();
            var result   = solution.RemoveDuplicates(new int[] { });

            Assert.AreEqual(0, result);
        }
コード例 #3
0
        public void RemoveDuplicatesTest_TwoItem()
        {
            var input = new int[] { 1, 1 };

            var solution = new _080_RemoveDuplicatesFromSortedArray2();
            var result = solution.RemoveDuplicates(input);

            Assert.AreEqual(2, result);
            AssertHelper.AssertArray(new int[] { 1, 1 }, input);
        }
コード例 #4
0
        public void RemoveDuplicatesTest()
        {
            var input = new int[] { 1, 1, 2, 2, 2, 3 };

            var solution = new _080_RemoveDuplicatesFromSortedArray2();
            var result = solution.RemoveDuplicates(input);

            Assert.AreEqual(5, result);
            AssertHelper.AssertArray(new int[] { 1, 1, 2, 2, 3 }, input, true);
        }
コード例 #5
0
        public void RemoveDuplicatesTest()
        {
            var input = new int[] { 1, 1, 2, 2, 2, 3 };

            var solution = new _080_RemoveDuplicatesFromSortedArray2();
            var result   = solution.RemoveDuplicates(input);

            Assert.AreEqual(5, result);
            AssertHelper.AssertArray(new int[] { 1, 1, 2, 2, 3 }, input, true);
        }
コード例 #6
0
        public void RemoveDuplicatesTest_TwoItem()
        {
            var input = new int[] { 1, 1 };

            var solution = new _080_RemoveDuplicatesFromSortedArray2();
            var result   = solution.RemoveDuplicates(input);

            Assert.AreEqual(2, result);
            AssertHelper.AssertArray(new int[] { 1, 1 }, input);
        }