示例#1
0
 public IEnumerable <string> GenerateHints(string hintKeys, int quantity)
 {
     if (hintKeys.Contains('|'))
     {
         return(AlternateHintGenerator.Generate(hintKeys, quantity));
     }
     return(HintGenerator.Generate(hintKeys, quantity));
 }
 public void AlternateHintGeneratorTest1()
 {
     Enumerable.Range(1, 200).ToList().ForEach(amount =>
     {
         var hintKeys = "asdfg|hjkl";
         var result   = AlternateHintGenerator.Generate(hintKeys, amount);
         Assert.AreEqual(amount, result.Count());
         Assert.IsFalse(result.Any(x => result.Any(y => y.StartsWith(x) && y != x)));
         Assert.IsTrue(IsValidAlterneation(hintKeys, result));
     });
 }