public void Content_ReturnsContent() { using (var logger = new SimpleLogger()) { logger.WriteLine("Sample Text"); Assert.AreEqual("Sample Text" + Environment.NewLine, logger.Content); } }
public void HasContent_ReturnsTrueIfAny() { using (var logger = new SimpleLogger()) { logger.WriteLine(""); // should append a newline Assert.That(logger.HasContent); } }
/// ------------------------------------------------------------------------------------ /// <summary> /// Called when [request debug info]. /// </summary> /// <param name="commandObj">The command obj.</param> /// <returns></returns> /// ------------------------------------------------------------------------------------ public bool OnRequestDebugInfo(object commandObj) { CheckDisposed(); using (var logger = new SimpleLogger()) { m_xbvvc.LogStream = logger; int cv = m_sda.get_VecSize(m_hvoRoot, m_fakeFlid); if (cv > 0) { int hvoObjSel = m_sda.get_VecItem(m_hvoRoot, m_fakeFlid, m_selectedIndex < 0 ? 0 : m_selectedIndex); m_rootb.PropChanged(hvoObjSel, m_tagMe, 0, 0, 0); Update(); // causes the PropChanged to actually invoke the VC. } else { logger.WriteLine("The record list is empty."); } MessageBox.Show(this, logger.Content, "DEBUG: Row generation info"); } return true; }