English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'd like to use this to add some additional logging to a large set of existing cases. Anyone know offhand what magic to use below?

public class BaseClass
{
[SetUp]
public void setup()
{
string testName = ;
Console.WriteLine( testName+" is running:");
outputLoggingStuff();
}
.
.
.
}

public class TestClass : BaseClass
{
[Test]
public void whatever()
{
.
.
.
}
}

2006-06-06 13:55:42 · 1 answers · asked by Ryan 4 in Computers & Internet Programming & Design

1 answers

While I have not yet walked through a complete example of using NUnit with an attributed C# application, I can offer some suggestions.

You can use reflection to get a stack trace. Look at the documentation for System.Diagnostics namespace; most specifically the 'StackTrace' class. You can create an instance of the StackTrace object in your method and use the ToString() method to build a string representation of the call stack. This may help get the information you need.

2006-06-06 16:36:58 · answer #1 · answered by JFalcon 5 · 0 0

fedest.com, questions and answers