I have the following simple test case:
var uri = new Uri("http://foo.com/bar%2Fbaz");
Assert.AreEqual("http://foo.com/bar%2Fbaz", uri.AbsoluteUri);
This test fails on .NET 4 but passes on .NET 4.5, I can test this using ReSharper test runner which provides a handy CLR selection menu.
But if I run this test using nunit console runner like the following:
nunit-console.exe /framework:4.5 "C:\Data\Projects\UriTest\bin\Debug\UriTest.dll"
My tests get failed. I have even modified nunit-console.exe.config and added this:
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
and after adding this, I have started to get this output from runner:
Runtime Environment -
OS Version: Microsoft Windows NT 6.2.9200.0
CLR Version: 4.0.30319.34209 ( Net 4.5 )
ProcessModel: Default DomainUsage: Single
Execution Runtime: v4.5
But still my test fails. Any idea why this happens?