public TestableLoginEndpoint(Mock<IUserAccountService> service, TestableMappingEngine mappingEngine, Mock<ICookieStorage> cookieStorage, HttpContextBase httpContext, IDocumentSession session) : base(mappingEngine, session, service.Object) { Service = service; MappingEngine = mappingEngine.Mapper; HttpContext = httpContext; CookieStorage = cookieStorage; }
public void MapsRequestToViewModel() { var mappingEngine = new TestableMappingEngine(); var endpoint = new SummaryEndpoint(mappingEngine); var request = new SummaryRequest(); var expectedViewModel = new SummaryViewModel(); mappingEngine.Mapper.Setup(x => x.Map<SummaryRequest, SummaryViewModel>(request)).Returns(expectedViewModel); var viewModel = endpoint.Summary(request); viewModel.ShouldEqual(expectedViewModel); }
public TestableNewThreadEndpoint(TestableMappingEngine mapper, Mock<IDocumentSession> session) : base(mapper, session.Object) { Session = session; Mapper = mapper.Mapper; }
public TestableRegisterEndpoint(Mock<IUserAccountService> service, TestableMappingEngine mapper, IDocumentSession session) : base(service.Object, mapper, session) { Service = service; Mapper = mapper.Mapper; }