I write UnitTests (no integration-tests with device and stuff) for monotouch and monodroid in xamarin studio with NUnit.
That works great, besides the problem that I don't see any log output created by Debug.WriteLine
.
Does anybody know how to activate that in xamarin studio?
Thx!
Someone had posted this answer, but removed it for whatever reason. I'm reposting it for prosperity sake...
Debug.WriteLine does not seem to work in the Xamarin Studio, but Console.WriteLine does. With this in mind, you can do the following:
#if __ANDROID__ || __IOS__
Debug.WriteLine("My trace statement");
#else
Console.WriteLine("My trace statement");
#end if
Add this to your unit test SetUp
ConsoleTraceListener c = new ConsoleTraceListener (true);
Trace.Listeners.Add (c);
Debug.Trace()
will write messages, but you need the above listener to take those messages and send them to the console.
The output appears in the Test Results, Output panel
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With