Пример #1
0
        public void TestChunkBound()
        {
            var actual = Arr.Chunk(foobar, 2);

            CollectionAssert.AreEqual(new[] { "foo", "bar" }, actual[0]);
            CollectionAssert.AreEqual(new[] { "baz" }, actual[1]);
        }
Пример #2
0
        public void TestChunkInsufficientQuantity()
        {
            var source = new[] { "foo" };
            var actual = Arr.Chunk(source, 2);

            CollectionAssert.AreEqual(new[] { "foo" }, actual[0]);
        }
Пример #3
0
        public void TestChunk3()
        {
            var arr1 = new[] { "red" };

            var result = Arr.Chunk(arr1, 2);

            Assert.AreEqual("red", result[0][0]);
            Assert.AreEqual(1, result[0].Length);
        }
Пример #4
0
        public void TestChunk4()
        {
            var arr1 = new[] { "red", "white" };

            var result = Arr.Chunk(arr1, 2);

            Assert.AreEqual("red", result[0][0]);
            Assert.AreEqual("white", result[0][1]);
            Assert.AreEqual(2, result[0].Length);
        }
Пример #5
0
        public void TestChunk()
        {
            var arr1 = new[] { "red", "orange", "white", "dog", "cat" };

            var result = Arr.Chunk(arr1, 2);

            Assert.AreEqual("red", result[0][0]);
            Assert.AreEqual("orange", result[0][1]);
            Assert.AreEqual(2, result[0].Length);
            Assert.AreEqual("white", result[1][0]);
            Assert.AreEqual("dog", result[1][1]);
            Assert.AreEqual(2, result[1].Length);
            Assert.AreEqual("cat", result[2][0]);
            Assert.AreEqual(1, result[2].Length);
        }