Пример #1
0
 public void AddCombinatorialNodes(string[] leafNodes)
 {
     string[] leafNodeCombinations = new Combinations().FromArray(leafNodes);
     foreach (string leafNode in leafNodeCombinations) {
         AddChild(new Node(leafNode));
     }
 }
Пример #2
0
        public void Should_build_a_combination_from_an_array()
        {
            string[] combinations = new Combinations().FromArray(new string[] {"rap", "rock","pop"});

            Assert.That(combinations, Contains.Item("rap"));
            Assert.That(combinations, Contains.Item("rock"));
            Assert.That(combinations, Contains.Item("pop"));

            Assert.That(combinations, Contains.Item("rap-rock"));
            Assert.That(combinations, Contains.Item("rap-pop"));
            Assert.That(combinations, Contains.Item("rap-rock-pop"));
        }