Those that read my post about version 1.0 will hopefully remember that I wrote that it should be regarded as a sort of beta release. While writing that was cowardly of me I’m glad I did as I had apparently made no less than 49 interfaces internal instead of public.
This release, version 1.1, fixes that. Other than that no changes has been made and the facades that I have been using so far seems to work fine.
PS. For updates about new posts, sites I find useful and the occasional rant you can follow me on Twitter. You are also most welcome to subscribe to the RSS-feed.
This blog is built with EPiServer Community, EPiServer CMS, ASP.NET MVC and a bunch of other great products. The source code is available for download at the projects page, where you also can read more about this site and my other projects.
read more
Comments
Vlad 9 months ago
Tried to mock DataFacade in UT with NMock2 and realized that I can't write neither
DataFactoryFacade.Instance = new Mockery().NewMock();
nor
DataFactoryFacade.Instance = new Mockery().NewMock();
First causes compilation error and second runtime error.
Joel Abrahamsson 9 months ago
Hi Vlad!
Those two examples look the same, but I guess the second one should have been:
Anyway, mocking DataFactoryFacade this way is often problematic as the DataFactoryFacade class provides all of the events that DataFactory has and in order to hook that up it must access DataFactory.Instance which in turn requires EPiServer to be started.
Instead I would recomment using IDataFactoryFacade and mocking that.
The same problem has also been discussed in the forum at Codeplex: http://epiabstractions.codeplex.com/Thread/View.aspx?ThreadId=70344
Hope that helps,
Joel