private static SearchController SearchControllerWithMockedSessionState(ISearchDetailsResult searchDetailsResult) { var digipostServiceMock =new Mock<IDigipostService>(); var controller = new SearchController(digipostServiceMock.Object); var context = new Mock<HttpContextBase>(); var session = new Mock<HttpSessionStateBase>(); session.Setup(x => x[SessionConstants.PersonDetails]).Returns(searchDetailsResult); context.Setup(x => x.Session).Returns(session.Object); var requestContext = new RequestContext(context.Object, new RouteData()); controller.ControllerContext = new ControllerContext(requestContext, controller); return controller; }
public ClientSmokeTestHelper Create_search_request() { _searchResult = _digipostClient.Search("Børre"); return(this); }