예제 #1
0
        public void TestMethod3()
        {
            PBDQConfig pC = conf.pBDQ;

            CheckConsistency(pC);
            Assert.IsTrue(pC.UpdateLetter(0, 'M', TestTheText.fixCFs[0]));
            Assert.IsTrue(pC.UpdateLetter(1, 'P', TestTheText.fixCFs[1]));
            Assert.IsTrue(pC.UpdateLetter(2, 'e', TestTheText.fixCFs[2]));
            Assert.IsTrue(pC.UpdateLetter(3, 'h', TestTheText.fixCFs[3]));
            CheckConsistency(pC);

            TestTheText ttt = new TestTheText(text1);

            ttt.MarkLetters(conf);
            int index = ttt.S.IndexOf("Monsieur");

            ttt.AssertCF(index, TestTheText.fixCFs[0]);
            ttt.AssertCF(index + 5, TestTheText.fixCFs[2]);
            index = ttt.S.IndexOf("Poiret");
            ttt.AssertCF(index, TestTheText.fixCFs[1]);
            index = ttt.S.IndexOf("cachait");
            ttt.AssertCF(index + 3, TestTheText.fixCFs[3]);

            string Ms = ttt.GetCharsInCol(TestTheText.fixCols[0]);

            Assert.IsTrue(Ms.Length > 0);
            foreach (char c in Ms)
            {
                Assert.AreEqual('M', c);
            }

            string Ps = ttt.GetCharsInCol(TestTheText.fixCols[1]);

            Assert.IsTrue(Ps.Length > 0);
            foreach (char c in Ps)
            {
                Assert.AreEqual('P', c);
            }

            string es = ttt.GetCharsInCol(TestTheText.fixCols[2]);

            Assert.IsTrue(es.Length > 0);
            foreach (char c in es)
            {
                Assert.AreEqual('e', c);
            }

            string hs = ttt.GetCharsInCol(TestTheText.fixCols[3]);

            Assert.IsTrue(hs.Length > 0);
            foreach (char c in hs)
            {
                Assert.AreEqual('h', c);
            }
        }