I have been following the instructions to get nunit 3 running in Team city found here:
My tests run locally on my dev box (in resharper and from the command line using a MSBuild script).
I tried to use the Nunit Build Step but I ran into strange problems:
- DLL reference problems, example:
System.IO.FileLoadException : Could not load file or assembly 'System.Web.Mvc, Version=18.104.22.168, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
This test ran fine before the change to Nunit 3 and it runs fine locally. This isn't the only DLL that is problem, different tests complain about different DLLs.
2. Problems with Ninject. I have some unit tests that verify things related to our dependancy injection.
System.NotSupportedException : Error loading module 'Ninject.Web.Common.WebCommonNinjectModule' of type WebCommonNinjectModule
Another module (of type WebCommonNinjectModule) with the same name has already been loaded
1) Ensure that you have not accidentally loaded the same module twice.
2) If you are using automatic module loading, ensure you have not manually loaded a module
that may be found by the module loader.
This test ran fine before the change to Nunit 3 and it runs fine locally.
I created an Msbuild step to run my Test that runs the same target I run locally and this also runs find through TeamCity. But with Unit tests running this way I don't get any code coverage.
Does anyone know how I can fix the above problems so I can get code coverage back?