示例#1
0
        public void PartitionBlocks()
        {
            KnotHash kh     = new KnotHash();
            var      input  = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
            var      blocks = kh.PartitionList(input, 4);

            Assert.Equal(3, blocks.Count);

            var arrayBlocks = blocks.ToArray();

            Assert.Equal(new int[] { 1, 2, 3, 4 }, arrayBlocks[0]);
            Assert.Equal(new int[] { 5, 6, 7, 8 }, arrayBlocks[1]);
            Assert.Equal(new int[] { 9, 10, 11, 12 }, arrayBlocks[2]);
        }