Пример #1
0
        public void testGeneration()
        {
            IList <IList <string> > generatedStrings = new List <IList <string> >();

            CombinationGenerator.generate(
                new List <string>()
            {
                "a", "b"
            },
                new List <string>(),
                generatedStrings,
                2
                );

            Assert.AreEqual(4, generatedStrings.Count);

            foreach (var generatedString in generatedStrings)
            {
                Assert.AreEqual(2, generatedString.Count);
            }

            Assert.AreEqual(new List <string> {
                "a", "a"
            }, generatedStrings[0]);
            Assert.AreEqual(new List <string> {
                "a", "b"
            }, generatedStrings[1]);
            Assert.AreEqual(new List <string> {
                "b", "a"
            }, generatedStrings[2]);
            Assert.AreEqual(new List <string> {
                "b", "b"
            }, generatedStrings[3]);
        }