public void SetAnnotation() { MultiTextBase MultiTextBase = new MultiTextBase(); MultiTextBase.SetAnnotationOfAlternativeIsStarred("zz", true); Assert.AreEqual(String.Empty, MultiTextBase.GetExactAlternative("zz")); Assert.IsTrue(MultiTextBase.GetAnnotationOfAlternativeIsStarred("zz")); MultiTextBase.SetAnnotationOfAlternativeIsStarred("zz", false); Assert.IsFalse(MultiTextBase.GetAnnotationOfAlternativeIsStarred("zz")); }
public void UsesNextAlternativeWhenMissing() { MultiTextBase MultiTextBase = new MultiTextBase(); MultiTextBase["wsWithNullElement"] = null; MultiTextBase["wsWithEmptyElement"] = ""; MultiTextBase["wsWithContent"] = "hello"; Assert.AreEqual(String.Empty, MultiTextBase.GetExactAlternative("missingWs")); Assert.AreEqual(String.Empty, MultiTextBase.GetExactAlternative("wsWithEmptyElement")); Assert.AreEqual("hello", MultiTextBase.GetBestAlternative("missingWs")); Assert.AreEqual("hello", MultiTextBase.GetBestAlternative("wsWithEmptyElement")); Assert.AreEqual("hello*", MultiTextBase.GetBestAlternative("wsWithEmptyElement", "*")); Assert.AreEqual("hello", MultiTextBase.GetBestAlternative("wsWithNullElement")); Assert.AreEqual("hello*", MultiTextBase.GetBestAlternative("wsWithNullElement", "*")); Assert.AreEqual("hello", MultiTextBase.GetExactAlternative("wsWithContent")); Assert.AreEqual("hello", MultiTextBase.GetBestAlternative("wsWithContent")); Assert.AreEqual("hello", MultiTextBase.GetBestAlternative("wsWithContent", "*")); }