Ejemplo n.º 1
0
        public void TestFormatage1()
        {
            UnsetBehConf uB  = conf.unsetBeh;
            ColConfWin   ccw = conf.colors[PhonConfType.phonemes];
            SylConfig    sC  = conf.sylConf;

            RGB            color   = new RGB(25, 100, 200);
            RGB            hiColor = new RGB(200, 100, 25);
            CharFormatting cfAll   = new CharFormatting(true, true, true, true, true, color, true, hiColor);

            ccw.SetCbxAndCF("m", cfAll);

            TestTheText ttt = new TestTheText(text1);

            ttt.ColorizePhons(conf, PhonConfType.phonemes);
            ttt.AssertBold(0, true);
            ttt.AssertItalic(0, true);
            ttt.AssertUnderline(0, true);
            ttt.AssertColor(0, color);
            ttt.AssertChangeHilight(0, true);
            ttt.AssertHilightColor(0, hiColor);
            ttt.AssertBold(10, true); // La config par défaut fait ça.
            ttt.AssertColor(10, TestTheText.black);

            ccw.SetCerasRose();
            uB.SetCbuFlag("Bold", true);
            ttt.ColorizePhons(conf, PhonConfType.phonemes);
            ttt.AssertBold(0, false);
            ttt.AssertItalic(0, true);
            ttt.AssertUnderline(0, true);
            ttt.AssertColor(0, color);
            ttt.AssertChangeHilight(0, true);
            ttt.AssertHilightColor(0, hiColor);
            ttt.AssertBold(10, true); // Ceras rosé fait ça.
            ttt.AssertColor(10, TestTheText.black);

            uB.SetCbuFlag("All", true);
            ttt.ColorizePhons(conf, PhonConfType.phonemes);
            ttt.AssertBold(0, false);
            ttt.AssertItalic(0, false);
            ttt.AssertUnderline(0, false);
            ttt.AssertColor(0, TestTheText.black);
            ttt.AssertChangeHilight(0, false);
            ttt.AssertBold(10, true); // Ceras rosé fait ça.
            ttt.AssertColor(10, TestTheText.black);

            ttt.ColorizePhons(conf, PhonConfType.muettes);
            ttt.AssertBold(0, false);
            ttt.AssertItalic(0, false);
            ttt.AssertUnderline(0, false);
            ttt.AssertColor(0, TestTheText.black);
            ttt.AssertChangeHilight(0, false);
            ttt.AssertBold(10, false);
            ttt.AssertColor(10, TestTheText.black);
        }
Ejemplo n.º 2
0
        public void TestFormatage2()
        {
            UnsetBehConf uB  = conf.unsetBeh;
            ColConfWin   ccw = conf.colors[PhonConfType.phonemes];
            SylConfig    sC  = conf.sylConf;

            RGB            color   = new RGB(25, 100, 200);
            RGB            hiColor = new RGB(200, 100, 25);
            CharFormatting cfAll   = new CharFormatting(true, true, true, true, true, color, true, hiColor);

            ccw.SetCbxAndCF("p", cfAll);
            TestTheText ttt = new TestTheText(text1);

            ttt.ColorizePhons(conf, PhonConfType.phonemes);
            ttt.AssertBold(9, true);
            ttt.AssertItalic(9, true);
            ttt.AssertUnderline(9, true);
            ttt.AssertColor(9, color);
            ttt.AssertChangeHilight(9, true);
            ttt.AssertHilightColor(9, hiColor);
            ttt.AssertBold(10, true); // La config par défaut fait ça.
            ttt.AssertColor(10, TestTheText.black);

            ttt.MarkLetters(conf); // ça ne devrait pas toucher au P majuscule...
            ttt.AssertBold(9, true);
            ttt.AssertItalic(9, true);
            ttt.AssertUnderline(9, true);
            ttt.AssertColor(9, color);
            ttt.AssertChangeHilight(9, true);
            ttt.AssertHilightColor(9, hiColor);
            ttt.AssertBold(10, true);
            ttt.AssertColor(10, TestTheText.black);

            uB.SetCbuFlag("Italic", true);
            ttt.MarkLetters(conf);
            ttt.AssertBold(9, true);
            ttt.AssertItalic(9, false);
            ttt.AssertUnderline(9, true);
            ttt.AssertColor(9, color);
            ttt.AssertChangeHilight(9, true);
            ttt.AssertHilightColor(9, hiColor);
            ttt.AssertBold(10, true);
            ttt.AssertColor(10, TestTheText.black);

            uB.SetCbuFlag("Underline", true);
            ttt.MarkLetters(conf);
            ttt.AssertBold(9, true);
            ttt.AssertItalic(9, false);
            ttt.AssertUnderline(9, false);
            ttt.AssertColor(9, color);
            ttt.AssertChangeHilight(9, true);
            ttt.AssertHilightColor(9, hiColor);
            ttt.AssertBold(10, true);
            ttt.AssertColor(10, TestTheText.black);

            uB.SetCbuFlag("All", true);
            ttt.MarkLetters(conf);
            ttt.AssertBold(9, false);
            ttt.AssertItalic(9, false);
            ttt.AssertUnderline(9, false);
            ttt.AssertColor(9, TestTheText.black);
            ttt.AssertChangeHilight(9, false);
            ttt.AssertBold(10, false);
            ttt.AssertColor(10, TestTheText.black);
        }