Пример #1
0
        public void TestStringService_GetT9Code()
        {
            ILetterMappingRepository letterMappingRepository = new LetterMappingRepository();
            ISettingsRepository      settingsRepository      = new SettingsRepository();
            IStringService           stringService           = new StringService();
            string output = stringService.GetT9Code(letterMappingRepository.Get(),
                                                    "hello world", false, settingsRepository.GetSmallInputLengthConstraint());

            Assert.IsTrue(output == "4433555 555666096667775553");
        }
Пример #2
0
        public void TestMappingRepository_LetterMapping()
        {
            ILetterMappingRepository   letterMappingRepository = new LetterMappingRepository();
            IDictionary <char, string> map = letterMappingRepository.Get();

            Assert.IsTrue(map['a'] == "2");
            Assert.IsTrue(map['b'] == "22");
            Assert.IsTrue(map['c'] == "222");
            Assert.IsTrue(map['d'] == "3");
            Assert.IsTrue(map['e'] == "33");
            Assert.IsTrue(map['f'] == "333");
            Assert.IsTrue(map['g'] == "4");
            //...
        }