예제 #1
0
        public void ShouldPartitionOneElementEachSide()
        {
            Node head = Node.FromString("51;50;49");

            Node partitioned = new PartitionSolver().Partition(head, 50);

            Assert.Equal("49;51;50;", partitioned.ToString());
        }
예제 #2
0
        public void ShouldPartitionEmptyStringLowerX()
        {
            Node head = new Node(5);

            Node partitioned = new PartitionSolver().Partition(head, 1);

            Assert.Equal("5;", partitioned.ToString());
        }
예제 #3
0
        public void ShouldRetornOnlyHigherValues()
        {
            Node head = Node.FromString("12;13;14");

            Node partitioned = new PartitionSolver().Partition(head, 10);

            Assert.Equal("12;13;14;", partitioned.ToString());
        }
예제 #4
0
        public void ShouldPartitionString()
        {
            Node head = Node.FromString("1;2;8;9;3;5;5;3");

            Node partitioned = new PartitionSolver().Partition(head, 5);

            Assert.Equal("1;2;3;3;8;9;5;5;", partitioned.ToString());
        }