Beispiel #1
0
        private void CheckAlernateCF(CharFormatting cf1, CharFormatting cf2, CharFormatting cf3,
                                     Config c)
        {
            SylConfig syc = c.sylConf;

            syc.ResetCounter();
            for (int i = 0; i < 10; i++)
            {
                CharFormatting cfFirst = syc.NextCF();
                Assert.AreEqual(cf1, cfFirst);
                CharFormatting cfSecond = syc.NextCF();
                Assert.AreEqual(cf2, cfSecond);
                CharFormatting cfThird = syc.NextCF();
                Assert.AreEqual(cf3, cfThird);
            }

            syc.ResetCounter();
            TestTheText ttt = new TestTheText(text1);

            ttt.MarkWords(c);
            int index = ttt.S.IndexOf("Monsieur");

            ttt.AssertCF(index, 8, cf1);
            index = ttt.S.IndexOf("Poiret");
            ttt.AssertCF(index, 6, cf2);
            index = ttt.S.IndexOf("était");
            ttt.AssertCF(index, 5, cf3);
            index = ttt.S.IndexOf("une");
            ttt.AssertCF(index, 3, cf1);
            index = ttt.S.IndexOf("espèce");
            ttt.AssertCF(index, 6, cf2);
            index = ttt.S.IndexOf("couverte"); // pos 28
            ttt.AssertCF(index, 8, cf1);
        }
Beispiel #2
0
        private void CheckAlernateCF(CharFormatting cf1, Config c)
        {
            SylConfig syc = c.sylConf;

            syc.ResetCounter();
            for (int i = 0; i < 10; i++)
            {
                CharFormatting cf = syc.NextCF();
                Assert.AreEqual(cf1, cf);
            }

            TestTheText ttt = new TestTheText(text1);

            ttt.MarkWords(c);
            int index = ttt.S.IndexOf("Poiret");

            ttt.AssertCF(index, 6, cf1);
            index = ttt.S.IndexOf("était");
            ttt.AssertCF(index, 5, cf1);
            index = ttt.S.IndexOf("espèce");
            ttt.AssertCF(index, 6, cf1);
        }