public void AbdulsAlgorithm() { var abdulResult = Permutations.AbdulsAlgorithm( new List <List <object> >() { new List <object>() { "1", "2" }, new List <object>() { "1", "2", "3" }, new List <object>() { "1", "2" } }); var results = abdulResult.Select(x => string.Join(',', x)).ToList(); Assert.True(results.Distinct().Count() == results.Count); Assert.Equal(12, results.Count); Assert.Contains("1,1,1", results); }
public void AbdulsAlgorithm_AllCombinationsTest(string combinationAsString) { var abdulResult = Permutations.AbdulsAlgorithm( new List <List <object> >() { new List <object>() { "1", "2" }, new List <object>() { "1", "2", "3" }, new List <object>() { "1", "2" } }); var results = abdulResult.Select(x => string.Join(',', x)).ToList(); Assert.Contains(combinationAsString, results); }