I’m trying to set up Moles to use in our unit testing. We are using xunit, so I am using the Xunit extension that comes with moles (Microsoft.Moles.Framework.Xunit). However, as we are running Xunit 1.7, Moles is complaining that I am not running Version 1.6.1.1521 (with a FileLoadException).
The Moles Manual (page 28) does say:
xUnit.net Version:
1.5.0.1479 (for other xUnit.net versions, recompile the attribute from sources)
This is where I get stuck – is the source code for this xunit extension available somewhere? Or will I have to use the specific version of xunit that Moles requires?
While proxon’s answer was very helpful for getting my task done, allow me to present a better answer I found as I investigated further (to hopefully help others coming across this problem). The source code is found in
C:\Program Files\Microsoft Moles\Documentation\moles.samples.zip. Pretty much identical to the code that proxon decompiled, of course.You can also find the NUnit and MbUnit wrappers in there.