Esempio n. 1
0
        public void PermutationVisitorTest()
        {
            var dimensionArray = new int[] { 2, 3, 2 };
            var outerProduct   = new OuterProductIndexGenerator(dimensionArray);
            var processor      = new OuterProductProcessorOneLineString(null);

            outerProduct.ProcessOuterProduct(processor);
            string s = processor.GetResult();

            Assert.That(s, Is.EqualTo("{{(0,0,0),(0,0,1)},{(0,1,0),(0,1,1)},{(0,2,0),(0,2,1)}},{{(1,0,0),(1,0,1)},{(1,1,0),(1,1,1)},{(1,2,0),(1,2,1)}}"));
        }
Esempio n. 2
0
        public void VisitorNestedForTest2()
        {
            var rectangularArray = new string[, , ] {
                { { null, null }, { null, null }, { null, null } }, { { null, null }, { null, null }, { null, null } }
            };
            var outerProduct = new OuterProductIndexGenerator(rectangularArray);
            var processor    = new OuterProductProcessorOneLineString(rectangularArray);

            outerProduct.ProcessOuterProduct(processor);
            string s = processor.GetResult();

            Assert.That(s, Is.EqualTo("{{(0,0,0),(0,0,1)},{(0,1,0),(0,1,1)},{(0,2,0),(0,2,1)}},{{(1,0,0),(1,0,1)},{(1,1,0),(1,1,1)},{(1,2,0),(1,2,1)}}"));
        }