Example #1
0
        public void ReturnsSingleDigitCombinations(string input, IEnumerable <string> expected)
        {
            var target = new TextPredictor();

            var actual = target.GetLetterCombinations(input);

            Assert.Equal(expected, actual);
        }
Example #2
0
        public void ReturnsBabyGotBack()
        {
            const string expected = "mixalot";

            var target = new TextPredictor();

            var actual = target.GetLetterCombinations("6492568");

            Assert.Contains(expected, actual);
        }
Example #3
0
        public void ReturnsExampleDoubleDigitCombinations()
        {
            var expected = new[] { "ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf" };

            var target = new TextPredictor();

            var actual = target.GetLetterCombinations("23");

            Assert.Equal(expected, actual);
        }
Example #4
0
        public void RejectsNullInput()
        {
            var target = new TextPredictor();

            Assert.Throws <ArgumentNullException>(() => target.GetLetterCombinations(null));
        }
Example #5
0
        public void RejectsOutOfRangeInput()
        {
            var target = new TextPredictor();

            Assert.Throws <FormatException>(() => target.GetLetterCombinations("cat"));
        }