Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I see Debug.WriteLine statements when using TestDriven.Net?
    text
    copied!<p>I'm trying to use TestDriven.Net not only to test my code, but to call a function on my code whose purpose is to print out the internal state of the code to the Debug window.</p> <p>Here's a very simplified example of what I'm trying to do..</p> <pre><code>&lt;TestFixture()&gt; _ Public Class UnitTest &lt;Test()&gt; _ Public Sub TestDebug() Dim oClass1 As New Class1 Assert.AreEqual(True, oClass1.IsTrue) Debug.WriteLine("About to call .PrintDebug()") oClass1.PrintToDebug() End Sub End Class Public Class Class1 Private _IsTrue As Boolean = True Public ReadOnly Property IsTrue() As Boolean Get Return _IsTrue End Get End Property Public Sub PrintToDebug() Debug.WriteLine("Internal state of Class1: " &amp; _IsTrue) End Sub End Class </code></pre> <p>I'm trying to test the Public interface of Class1, and somehow view the output from the <code>Class1.PrintToDebug()</code> function.</p> <p>I've looked through the <a href="http://www.testdriven.net/quickstart.aspx" rel="nofollow noreferrer">TestDriven.Net quickstart</a>, which shows examples of using the <code>Debug.WriteLine</code> in a unit test, but strangely this doesn't work for me either - i.e. the only Output in my 'Test' window is:</p> <pre><code>------ Test started: Assembly: ClassLibrary1.dll ------ 1 passed, 0 failed, 0 skipped, took 1.19 seconds. </code></pre> <p>I've tried looking in the other windows (Debug and Build), the Debug window has the 'Program Output' and 'Exception Messages' options enabled.</p> <p>I've looked for options or preferences and can't find any!</p> <p>Thanks for your help!</p> <p><hr /> <strong>Edit:</strong> I'm using VB.Net 2.0, TestDriven.Net 2.14.2190 and NUnit 2.4.8.0</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload