AI OnAI Off
Hi,
I think that this blog post describe solution for your problem:
http://tedgustaf.com/blog/2013/10/unit-testing-in-episerver-7/
I don't want to MOCK.. I want to do Integration tests, which means no mocking, actual objects are needed for that.
I have added a test project, and I want to test creating pages programtically. Since the Test Project is the Entry Point, I keep getting this error:
An exception of type 'StructureMap.StructureMapConfigurationException' occurred in StructureMap.dll but was not handled in user code
Additional information: No default Instance is registered and cannot be automatically determined for type 'EPiServer.IContentRepository'
I am referening this article
Create Page Programaticallyhttp://world.episerver.com/documentation/Items/Developers-Guide/Episerver-CMS/9/Content/Creating-a-page-programmatically/
to create pages, but cannot figure out how to get StuctureMap to load it's configuration in a Unit Test Project.
The error happens on this line:
IContentRepository contentRepository = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance();
I have searched and looked at StructureMap's site, but I don't find that useful.
Someone out here has to have created an integration test project to test functionality. Basically I know the Structure Map configuration needs to be loaded by the test project, but I cannot figure out how do that.
Thanks,
-Bernie