I am trying to use TestDriven.Net not only to test my code, but also to call a function in my code whose purpose is to print the internal state of the code in a debug window.
Here is a very simplified example of what I'm trying to do.
<TestFixture()> _
Public Class UnitTest
<Test()> _
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: " & _IsTrue)
End Sub
End Class
I am trying to check the open interface of Class1 and somehow view the output from the function Class1.PrintToDebug().
I looked at TestDriven.Net quickstart , which shows examples of use Debug.WriteLinein unit test, but strangely this also does not work for me - that is, the only way out in my "Test" window:
------ Test started: Assembly: ClassLibrary1.dll ------
1 passed, 0 failed, 0 skipped, took 1.19 seconds.
I tried to look in other windows (Debug and Build), the Debug window has the options "Program Exit" and "Exceptional Messages".
I searched for options or settings and cannot find them!
Thank you for your help!
Edit: I am using VB.Net 2.0, TestDriven.Net 2.14.2190 and NUnit 2.4.8.0
source
share