SIL.FieldWorks.TE.ImportTests.DummyTeImporter.VerifyAnnotationText C# (CSharp) Метод

VerifyAnnotationText() публичный Метод

Verifies that StText field for an annotation was initialized properly.
public VerifyAnnotationText ( IStText text, string fieldName, string expectedContents, int expectedWs ) : void
text IStText given StText
fieldName string name of field
expectedContents string Expected contents of (first and only) para (may be /// null)
expectedWs int Expected writing system ID (ignored if expectedContents is /// null)
Результат void
		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);
			}
		}