unit testing - Forcing nunit console runner to use CLR 4.5 -


i have 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 passes on .net 4.5, can test using resharper test runner provides handy clr selection menu.

but if run test using nunit console runner following:

nunit-console.exe /framework:4.5 "c:\data\projects\uritest\bin\debug\uritest.dll"

my tests failed. have modified nunit-console.exe.config , added this:

<supportedruntime version="v4.0" sku=".netframework,version=v4.5" /> 

and after adding this, have started output 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 test fails. idea why happens?

after taking more @ issue, here's information gathered different forums.

first, should detect runtime automatically. if doesn't (which seems case), can force framework using proper runtime using /framework command option.

what have in nunit-console.exe.config forces nunit runner use specified runtime. if assembly in different .net version, nunit run them in separate process force framework version.

see documentation nunit 2.6.2.

what have in command line shouldn't /framework:4.5 rather /framework:net-4.5

the next step take @ test , see if there's specific makes fail.

please comment more more info.


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -