jbtule
jbtule

Reputation: 31799

Portable Class Library Testing

So when testing a Portable Class Library without any platform specific code, is testing against just one of the platforms (.net 4.5) from the profile enough? My intuition says no, but I've read some claims otherwise.

And if you do need to test against each platform, do any of the multitude of test frameworks out there for .net have a PCL testing library with runners for each or most platforms, so only one DLL of unit tests would be necessary?

Upvotes: 6

Views: 1635

Answers (3)

noocyte
noocyte

Reputation: 2522

xUnit has implemented support for PCL: http://xunit.github.io/

Upvotes: 2

jbtule
jbtule

Reputation: 31799

I've created a project PclUnit to solve this in a way that you only need to create one Test project and can run it under one runner and it will test on multiple platforms.

It needs more work, and I need help from others to make it happen, but on windows it currently will test .net40-x85, .net40-x64, .net45-x86, .net45-x64, silverlight5-x86, and silverlight5-x64 all at once and aggregate the results.

It does build and run on mono 3.1.2, however each runner has to be run individually until I can get signalr working on mono. I hope to get a proof of concept iOS runner working soon.

Functionally it's similar to xunit's design, but syntactically it's more similar to nunit (includes nunit constraints ported over), but under the PclUnit.Style.Xunit namespace it changes to xunit labels and assertions.

Upvotes: 3

Daniel Plaisted
Daniel Plaisted

Reputation: 16744

It's usually best to test on all platforms. Right now I'm not aware of any test framework/runner that supports this. I'm hoping to help xUnit do so.

I've done a very simple implementation of a test framework for my PCL Storage library. So you could use that to get you started running tests on all the platforms.

Upvotes: 1

Related Questions