Пример #1
0
        public void PartitionTest_EmptyList()
        {
            var solution = new _086_PartitionList();
            var result   = solution.Partition(null, 3);

            Assert.IsNull(result);
        }
Пример #2
0
        public void PartitionTest_EmptyList()
        {
            var solution = new _086_PartitionList();
            var result = solution.Partition(null, 3);

            Assert.IsNull(result);
        }
Пример #3
0
        public void PartitionTest()
        {
            var input = TestHelper.GenerateList(new int[] { 1, 4, 3, 2, 5, 2 });

            var solution = new _086_PartitionList();
            var result   = solution.Partition(input, 3);

            AssertHelper.AssertLinkList(new int[] { 1, 2, 2, 4, 3, 5 }, result);
        }
Пример #4
0
        public void PartitionTest_OneItem_GreaterThan()
        {
            var input = TestHelper.GenerateList(new int[] { 1 });

            var solution = new _086_PartitionList();
            var result   = solution.Partition(input, 0);

            AssertHelper.AssertLinkList(new int[] { 1 }, result);
        }
Пример #5
0
        public void PartitionTest_OneItem_LessThan()
        {
            var input = TestHelper.GenerateList(new int[] { 1 });

            var solution = new _086_PartitionList();
            var result = solution.Partition(input, 3);

            AssertHelper.AssertLinkList(new int[] { 1 }, result);
        }
Пример #6
0
        public void PartitionTest_AllLessThan()
        {
            var input = TestHelper.GenerateList(new int[] { 1, 4, 3, 2, 5, 2 });

            var solution = new _086_PartitionList();
            var result = solution.Partition(input, 6);

            AssertHelper.AssertLinkList(new int[] { 1, 4, 3, 2, 5, 2 }, result);
        }