Im currently trying to hook up some unit tests for my controllers that inherit from "SurfaceController, IRenderMvcController". Ive got the Umbraco.Tests dll and configuration in my unit test project and my testfixture is inheriting from BaseRoutingTest and decorated with [DatabaseTestBehavior(DatabaseBehavior.NoDatabasePerFixture)].
Im creating my umbraco context in the setup using umbracoContext = GetRoutingContext("/").UmbracoContext;
The project builds but when im trying to run a test I get the following failure message
SetUp : System.TypeLoadException : Could not load type 'Umbraco.Core.Logging.Logger' from assembly 'Umbraco.Core, Version=1.0.5632.22681, Culture=neutral, PublicKeyToken=null'.
at Umbraco.Tests.TestHelpers.BaseUmbracoApplicationTest.InitializeFixture()
Im struggling to work out exactly what it is thats causing the problem, im thinking maybe something to do with dll versioning or something but ive now spent a full day trying to work it out to no avail..
I think I've found the solution. I had checked out the most recent version of the Umbraco solutions to compile the Umbraco.Tests.dll, though as I am running on 7.2.5, the solutions had some changes to the logger from when 7.2.5 was released.
Be sure to checkout the tag relating to your release.
Unit Testing Controllers
Hi guys,
Im currently trying to hook up some unit tests for my controllers that inherit from "SurfaceController, IRenderMvcController". Ive got the Umbraco.Tests dll and configuration in my unit test project and my testfixture is inheriting from BaseRoutingTest and decorated with [DatabaseTestBehavior(DatabaseBehavior.NoDatabasePerFixture)].
Im creating my umbraco context in the setup using umbracoContext = GetRoutingContext("/").UmbracoContext;
The project builds but when im trying to run a test I get the following failure message
Im struggling to work out exactly what it is thats causing the problem, im thinking maybe something to do with dll versioning or something but ive now spent a full day trying to work it out to no avail..
Any suggestions would be greatly appreciated.
Thanks
Having explored the assembly for Umbraco.Tests I can see that the code that fails is in the Umbraco.Tests.TestHelpers.BaseUmbracoApplicationTest
Where or what is Umbraco.Core.Logging.Logger as I cant see it if I view the object browser on Umbraco.Core?
I think I've found the solution. I had checked out the most recent version of the Umbraco solutions to compile the Umbraco.Tests.dll, though as I am running on 7.2.5, the solutions had some changes to the logger from when 7.2.5 was released.
Be sure to checkout the tag relating to your release.
Hope this helps
Gary
I'm currently having this same issue. The source of this file is here - I am continuing to investigate and will let you know if I make any progress.
Thank you all for your help, I got this working by downloading the correct version of the source code that related to the version we are running.
is working on a reply...