WriteLine() public method

Write a line of text to the log (preceded by the current indent).
public WriteLine ( string text ) : void
text string
return void
Ejemplo n.º 1
0
 public void Content_ReturnsContent()
 {
     using (var logger = new SimpleLogger())
     {
         logger.WriteLine("Sample Text");
         Assert.AreEqual("Sample Text" + Environment.NewLine, logger.Content);
     }
 }
Ejemplo n.º 2
0
 public void HasContent_ReturnsTrueIfAny()
 {
     using (var logger = new SimpleLogger())
     {
         logger.WriteLine("");                 // should append a newline
         Assert.That(logger.HasContent);
     }
 }
Ejemplo n.º 3
0
		/// ------------------------------------------------------------------------------------
		/// <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;
		}