コード例 #1
0
        public void ConvertWordToPhonemesTest(string word, string resultPhoneme)
        {
            ConverterWordToPhonemes converterWordToPhonemes = new ConverterWordToPhonemes();
            var actualResult = converterWordToPhonemes.ConvertWordToPhonemes(word).ToString();

            Assert.AreEqual(resultPhoneme, actualResult);
        }
コード例 #2
0
        public void SetWordTest(string word, string resultWord)
        {
            ConverterWordToPhonemes convererWordToPhonemes = new ConverterWordToPhonemes();

            convererWordToPhonemes.SetWord(word);
            Assert.AreEqual(resultWord, convererWordToPhonemes.Word);
        }
コード例 #3
0
        public void SetStressTest(string word, int resultStress)
        {
            ConverterWordToPhonemes convererWordToPhonemes = new ConverterWordToPhonemes();

            convererWordToPhonemes.SetWord(word);
            Assert.AreEqual(resultStress, convererWordToPhonemes.Stress);
        }
コード例 #4
0
        public void AddNullLetterTest(Letter letter)
        {
            ConverterWordToPhonemes converterWordToPhonemes = new ConverterWordToPhonemes();

            Assert.Throws <NullReferenceException>
            (
                () => converterWordToPhonemes.AddOtherLetterToPhonemes(letter)
            );
        }
コード例 #5
0
        public void ConvertNullWordToPhonemesTest(string word)
        {
            ConverterWordToPhonemes converterWordToPhonemes = new ConverterWordToPhonemes();

            Assert.Throws <NullReferenceException>
            (
                () => converterWordToPhonemes.ConvertWordToPhonemes(word)
            );
        }
コード例 #6
0
        public void AddNotRussianLetterTest(char letter)
        {
            Letter myLetter = new Letter
            {
                Current = letter
            };
            ConverterWordToPhonemes converterWordToPhonemes = new ConverterWordToPhonemes();

            Assert.Throws <ArgumentOutOfRangeException>
            (
                () => converterWordToPhonemes.AddOtherLetterToPhonemes(myLetter)
            );
        }