The coding blog of Alastair Smith, a software developer based in Cambridge, UK. Interested in DevOps, Azure, Kubernetes, .NET Core, and VueJS.
So my promised updates on other things haven’t quite come to fruition… This week’s been kinda busy.
But this evening I sat down with NAnt and NUnit to try and get my Unit Tests working under NUnit and running from the automated NAnt build, and, six hours later, I’m still here.
[img_assist|nid=21|title=|desc=|link=none|align=center|width=427|height=640]
The first headache was trying to get the
Line 7 should actually read:
so that my 2.4.7-bound tests can be run with the 2.2.8 binaries provided with NAnt. Something in Scott Hanselman’s post on the subject helped me grasp this fact in a flash of inspiration.
However, Scott recommends invoking nunit-console.exe with the <exec> task — a more generic call-an-external-program sort of task. For example,
Unfortunately, I’m back to square one with this method. Running nunit-console.exe directly from the command line gives me the exact same “could not load file or assembly” error that I was suffering earlier, and, unsurprisingly, I get the same results through my NAnt build:
Note there that NUnit version 2.4.7 is unable to load the nunit.framework assembly at version 2.4.7. I’ve trashed my test.config file, so I’m not doing any assembly re-binding any more, and NUnit is housed within it’s own directory in my working copy. Goodness only knows what’s going on here — maybe I’ll find out tomorrow…