public void AddCombinatorialNodes(string[] leafNodes) { string[] leafNodeCombinations = new Combinations().FromArray(leafNodes); foreach (string leafNode in leafNodeCombinations) { AddChild(new Node(leafNode)); } }
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")); }