Пример #1
0
        public void GetFirstMultigraph_GivenMultiLetterGraphs_IdentifiesTrigraphs()
        {
            var p = new MultigraphParser(new string[] { "oug", "ough", "ou" });

            Assert.AreEqual("OUGH", p.GetFirstMultigraph("ought"));
        }
Пример #2
0
        public void GetFirstMultigraph_GivenSomeDigraphs_StillIdentifiesSingleCharacters()
        {
            var p = new MultigraphParser(new string[] { "ng", "th" });

            Assert.AreEqual("T", p.GetFirstMultigraph("talk"));
        }
Пример #3
0
        public void GetFirstMultigraph_DigraphDoesNotMatch_GivesSingleLetter()
        {
            var p = new MultigraphParser(new string[] { "th", "t" });

            Assert.AreEqual("T", p.GetFirstMultigraph("talk"));
        }
Пример #4
0
        public void GetFirstMultigraph_GivenDigraphLettersFirst_IdentifiesWholeDigraph()
        {
            var p = new MultigraphParser(new string[] { "th", "t" });

            Assert.AreEqual("TH", p.GetFirstMultigraph("think"));
        }
Пример #5
0
        public void GetFirstMultigraph_WordStartsWithHyphen_GivesFirstLetterCharacterUppercase()
        {
            var p = new MultigraphParser(new string[] {});

            Assert.AreEqual("L", p.GetFirstMultigraph("-listen"));
        }
Пример #6
0
        public void GetFirstMultigraph_EmptyMultigraphList_GivesFirstCharacterUppercase()
        {
            var p = new MultigraphParser(new string[] {});

            Assert.AreEqual("L", p.GetFirstMultigraph("listen"));
        }