Пример #1
0
 public int CountSequencesFromKey(Key key, KeypadSequence sequence)
 {
     if (!sequence.IsValidSequence())
         return 0;
     if (sequence.Length == _pathSize)
         return 1;
     int count = 0;
     var possibleMoves = this._moveStrategy.GetPossibleMoves(key);
     foreach (var move in possibleMoves)
         count += CountSequencesFromKey(move, _board.KeyPress(move, new KeypadSequence(sequence)));
     return count;
 }
Пример #2
0
 public void test_sequence_with_more_than_2_vowels_is_invalid()
 {
     var sequence = new KeypadSequence();
     sequence.Add(Key.A).Add(Key.B).Add(Key.E).Add(Key.I);
     Assert.IsFalse(sequence.IsValidSequence());
 }
Пример #3
0
 public void test_sequence_with_lessthan_2_vowels_is_valid()
 {
     var sequence = new KeypadSequence();
     sequence.Add(Key.A).Add(Key.C).Add(Key.D);
     Assert.IsTrue(sequence.IsValidSequence());
 }