void
ToxTextGeneratorTest::ChapterNumberWithoutTextIsGeneratedForNoprepstTitle()
{
SwForm form;
ToxTextGeneratorWithMockedChapterField ttg(form); // set all values to make sure they are not used
ttg.GetChapterField().m_State.sNumber = "1";
ttg.GetChapterField().m_State.sPre = "PRE";
ttg.GetChapterField().m_State.sPost = "POST";
ttg.GetChapterField().m_State.sTitle = "TITLE";
// we cannot mock the pre- and suffix generation in the chapterfield. We just test that sNumber and // sTitle are used and hope that the pre- and suffix addition works.
token.nChapterFormat = CF_NUMBER;
expected = ttg.GenerateTextForChapterToken(token, nullptr, nullptr, nullptr);
CPPUNIT_ASSERT_EQUAL(expected, actual);
}
void
ToxTextGeneratorTest::ChapterNumberWithTitleIsGeneratedForNumberNoPrepst()
{
SwForm form;
ToxTextGeneratorWithMockedChapterField ttg(form); // set all values to make sure they are not used
ttg.GetChapterField().m_State.sNumber = "5";
ttg.GetChapterField().m_State.sPre = "PRE";
ttg.GetChapterField().m_State.sPost = "POST";
ttg.GetChapterField().m_State.sTitle = "myTitle";
// we cannot mock the pre- and suffix generation in the chapterfield. We just test that sNumber and // sTitle are used and hope that the pre- and suffix addition works.
token.nChapterFormat = CF_NUM_TITLE;
expected = ttg.GenerateTextForChapterToken(token, nullptr, nullptr, nullptr);
CPPUNIT_ASSERT_EQUAL(expected, actual);
}
// Put the test suite in the registry
CPPUNIT_TEST_SUITE_REGISTRATION(ToxTextGeneratorTest);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.