Unit testing and multi-targeting the .Net BCL

I’ve introduced XUnit and written some initial unit tests for several of the PatienceOS kernel classes.

Interestingly, the unit test approach involves building and linking the kernel against the standard .Net BCL, rather than my zerosharp-based, custom BCL ie. being able to multi-target which BCL to use. I took the idea from Michal Strehovskรฝ’s article, Building a self-contained game in C# under 8 kilobytes, namely:

One VS solution builds and links the PatienceOS kernel against the custom .Net BCL (zerosharp based), handy for when you are coding within Visual Studio and want to quickly check building against the custom runtime types.

And

The other VS solution builds and links the PatienceOS kernel against the standard .Net 8.0 runtime, allowing you to develop and run unit tests within the built-in Visual Studio Test Explorer, as per any other .Net unit test project.

And

Instructions are located here: Developing PatienceOS


Frank Ray Consulting. Software requirements for agile development teams, particularly remote, outsourced and offshore development teams working in financial services.

Get in touch if you need our help

Woking, Surrey, GU22, United Kingdom