Re: How do addon writers deal with NUnit versions?
Stefan Bodewig <[email protected]>
| Newsgroups | gmane.comp.windows.dotnet.nunit.user |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 2 Jun 2008, Charlie Poole <[email protected]> wrote: >> Hmm. XMLUnit is more of an Addon than an Addin following the >> definitions on your site. It really only adds new Assert >> classes and probably (I need to check) only uses Assert itself. > > OK - that's slightly different, since we're now talking about > nunit.framework, which is presumed to change whenever a user > wants to change it. NUnit itself protects itself by not having > any references at all to nunit.framework and using reflection. I see. > Of course, this makes sense from the point of view of .NET, > since XMLUnit might be using some method that exists in > 2.4.6 but not 2.4.7. That's not very likely, so you could > use a binding redirect at the user test level to force it > to work. I thought that would work, but it doesn't seem to be the case - or I may be using it the wrong way. In my little test I placed a <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssemby> <assemblyIdentity name="nunit.framework" culture="neutral" publicKeyToken="96d09a1eb7f44a77"/> <bindingRedirect oldVersion="2.4.6.0" newVersion="2.4.7.0"/> </dependentAssemby> </assemblyBinding> </runtime> </configuration> into a .config filed named just like my tests DLL, and this doesn't work. Neither does placing it into NUnit.exe.config. "Doesn't work" here means I still get the same exception. >> > 2) Use or modify my nant script (http://nunit.org/?p=addins) to >> > do your build. >> >> I've seen that, thanks. > > Of course, it's not relevant here since you are not doing an addin. It may still come in handy if I ever want to release separate DLLs built against different versions of NUnit or the .NET framework, so thanks. > In the meantime, it seems to me that the ideal solution > would be for XMLUnit to be a library of constraints that > can be used through the normal NUnit Assert.That() syntax. Fully agreed. This is what I advise people to do in Java land who want to use XMLUnit with TestNG as well. People seem to want the convenience method like XMLAssert.AreEqual() rather than Assert.That(XML.AreEqual(...)), still. As long as I'm not prepared to backwards compatibility I don't have a choice anyway. > Other than the fact that the user would have to modify > the test config, do you see any problems with use of > a binding redirect? If I can get it to work, I don't have any problem with it at all. Stefan ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/