Framework/visual studio project type to use for unit testing .net standard libray?

Viewed 550

Given that the implementation of the .net standard library is provided by the underlined implementation (.Net framework, .Net Core (windows/Linux etc) ). And it is possible that the APIs have little different behaviour. TimeZoneInfo.Id provides different results based on the OS (last time I checked).

So, how to unit test? In visual studio we can either create a .Net Core xUnit project or .Net Framework xUnit project. How to run the same xUnit tests in two different environment?

2 Answers

Instead of targeting multiple runtimes, you could just as well use a test platform that is capable of running net standard tests by default. Nuclear.Test can help you with a more complete feature test of your implementation on multiple platforms.

Related