예제 #1
0
파일: Node.cs 프로젝트: hibri/tree-path
 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"));
        }