nunit/nunit — pull request #313 by rprouse (2014-10-27 03:25:41+00:00)
Title: Issue 261 - NUnit Portable

**Do not merge**, I am creating the pull request so we can start discussing if a Portable NUnitLite makes sense. Personally, I think it is the only maintainable approach to supporting other platforms like iOS, Android, Windows Phone, etc.

Portable libraries have limited thread, filesystem, serialization and appdomain support and reflection is also limited, although not as badly. Because of this, NUnitLite Portable has the Silverlight features minus the following;

- PlatformAttribute
- Attribute and AttributeExists constraints
- TimeoutAttribute
- TheoryAttribute
- DatapointProvider
- DelayedConstraint
- Various threading attributes (MTA, STA)
- Various Path constraints
- All tests run on the main thread

By definition, portable code cannot contain any runner code. The runner code needs to be in a platform specific assembly. To demonstrate how this works, I created an nunitlite.runner-sl-5.0 project and converted the Silverlight tests to use the portable library and the SilverLight framework.

We may be able to get several of the deleted features working by reworking the reflection code and moving some code across the portable/runner boundary. WorkItem is one example.

We would then need to provide runners for each of the platforms we want NUnitLite to support, although we might want to leave some platforms up to others. For example, Xamarin already has decent NUnitLite 2.0 runners for iOS and Android.

This PR brings up the question, "What is our vision of NUnitLite?" The desktop version is nearly feature compatible with the full framework. The CF version is adding features and becoming closer to the desktop version. Meanwhile, on phone platforms, we will be supporting a much smaller subset of features.

I wonder if we should drop the NUnitlite moniker and just call it NUnit? We could do the following;

- On Windows, we will provide the full framework and a runner assembly that you can link into your tests to make them a self executing test EXE if you want the nunitlite experience.
- CF will be similar, a full featured framework and a CF runner.
- Silverlight and mobile platforms will use the portable nunit.framework and platform specific runners.

If anyone wants to check out the code, there is a new `Portable` folder and most of the changes are to the Silverlight project since it is very similar in nature to the mobile platforms we will want to target.