Xamarin.Android.NUnitLite Runner

safwancsafwanc USMember
edited October 2015 in Xamarin.Android

We are trying to provide a custom TextWriter for the Xamarin.Android.NUnitLite test runner so that we can get the test results in the NUnit XML format. This is being done to enable test result integration into our CI setup with TeamCity.

The problem we’re facing is that while the iOS TouchRunner class provides a simple attribute which we’re modifying as follows:

runner = new TouchRunner(window);
runner.Writer = new NUnitOutputTextWriter(runner, new TcpTextWriter("127.0.0.1", 16997), new NUnit3XmlOutputWriter(DateTime.Now));
runner.AutoStart = true;
runner.TerminateAfterExecution = true;  

However, the Xamarin.Android.NUnitLite runner we’re using has information passed to it through the intent system and we can’t seem to find the documentation or source code for it anywhere. Currently, we are setting up the runner in a TestSuiteActivity and passing information as follows:

Intent.PutExtra("automated", true);
Intent.PutExtra("remote", true);
Intent.PutExtra("hostName", "10.0.2.2");  
Intent.PutExtra("hostPort", 16997);  

Question 1: How can we provide a custom TextWriter implementation to get the NUnit results in XML form for Android like we have done with iOS?
Question 2: Is the source code for Xamarin.Android.NUnitLite available anywhere for us to examine? The closest we’ve come to is @SebastienPouliot Andr.Unit repository but it seems like Xamarin.Android.NUnitLite has forked from this code base?

Posts

Sign In or Register to comment.