November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
The method you are trying to mock is not actully on the interface but is an extension method to the interface. Try mock method with following signature instead:
EPiServer.Core.PageDataCollection FindPagesWithCriteria(EPiServer.Core.PageReference pageLink, PropertyCriteriaCollection criterias, string languageBranch, EPiServer.Core.ILanguageSelector selector)
Hi all
I'm trying to mock IPageCriteriaQueryService with RhinoMocks. At the moment I've got this (failing code)
But it fails when setting up the mocks. It seems to want a language to be set i.e. this line in the stack trace - EPiServer.Globalization.ContentLanguage.get_PreferredCulture()
The full trace is
at EPiServer.BaseLibrary.ClassFactory.get_Instance()
at EPiServer.Globalization.ContentLanguage.get_PreferredCulture()
at EPiServer.Core.PageCriteriaQueryServiceExtensions.FindPagesWithCriteria(IPageCriteriaQueryService queryService, PageReference pageLink, PropertyCriteriaCollection criterias)
at NitbWebNUnit.Setup.ServiceLocatorSetup.<InitPageQueryService>b__3(IPageCriteriaQueryService x) in c:\code\NITB\Cds.Nitb.Web.NUnit\Setup\ServiceLocatorSetup.cs:line 68
at Rhino.Mocks.RhinoMocksExtensions.Expect[T,R](T mock, Function`2 action)
at Rhino.Mocks.RhinoMocksExtensions.Stub[T,R](T mock, Function`2 action)
at NitbWebNUnit.Setup.ServiceLocatorSetup.InitPageQueryService() in c:\code\NITB\Cds.Nitb.Web.NUnit\Setup\ServiceLocatorSetup.cs:line 68
at NitbWebNUnit.TidiMigrationTest.CanMigrateOneRecord() in c:\code\NITB\Cds.Nitb.Web.NUnit\TidiMigrationTest.cs:line 16
Can anyone cast any light on this.
Many thanks for any/all help
Tim B