public void VerifyAnnotationText(IStText text, string fieldName,
string expectedContents, int expectedWs)
{
Assert.AreEqual(1, text.ParagraphsOS.Count, fieldName + " should have 1 para");
IStTxtPara para = (IStTxtPara)text.ParagraphsOS[0];
Assert.IsNotNull(para.StyleRules, fieldName + " should have a para style.");
// We do not care about style for annotations because they get changed when displayed.
//Assert.AreEqual(ScrStyleNames.Remark,
// para.StyleRules.GetStrPropValue((int)FwTextPropType.ktptNamedStyle),
// fieldName + " should use Remark style.");
if (expectedContents == null)
Assert.IsNull(para.Contents.Text, fieldName + " should have 1 empty para.");
else
{
ITsString tss = para.Contents;
Assert.AreEqual(1, tss.RunCount);
AssertEx.RunIsCorrect(tss, 0, expectedContents, null, expectedWs);
}
}