public void TextPageUtilSetText() { tlog.Debug(tag, $"TextPageUtilSetText START"); TextPageUtil testingTarget = new TextPageUtil(); Assert.IsNotNull(testingTarget, "Can't create success object TextPageUtil"); Assert.IsInstanceOf <TextPageUtil>(testingTarget, "Should be an instance of TextPageUtil type."); using (TextLabel label = new TextLabel()) { label.EnableMarkup = true; label.Text = "PublicPageUtilTest"; var result = testingTarget.SetText(label, "MyPageUtil"); Assert.IsNotNull(result); } // label.EnableMarkup = false using (TextLabel label = new TextLabel()) { label.EnableMarkup = false; label.Text = "PublicPageUtilTest"; var result = testingTarget.SetText(label, "MyPageUtil"); Assert.IsNotNull(result); } testingTarget.Dispose(); tlog.Debug(tag, $"TextPageUtilSetText END (OK)"); }
public void TextPageUtilGetText() { tlog.Debug(tag, $"TextPageUtilGetText START"); TextPageUtil testingTarget = new TextPageUtil(); Assert.IsNotNull(testingTarget, "Can't create success object TextPageUtil"); Assert.IsInstanceOf <TextPageUtil>(testingTarget, "Should be an instance of TextPageUtil type."); using (TextLabel label = new TextLabel()) { label.EnableMarkup = true; label.Text = "PublicPageUtilTest"; var result = testingTarget.SetText(label, "MyPageUtil"); Assert.IsNotNull(result); /** if param is 0 will return */ try { testingTarget.GetText(0); } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception: Failed!"); } try { testingTarget.GetText(1); } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception: Failed!"); } } testingTarget.Dispose(); tlog.Debug(tag, $"TextPageUtilGetText END (OK)"); }