public void IndexGET_GivenDisclaimer_DisclaimerViewModelBuilderShouldBeCalled() { var disclaimer = new Disclaimer(); A.CallTo(() => _queryDispatcher.Dispatch <DisclaimerByUserQuery, Disclaimer>(A <DisclaimerByUserQuery> ._)).Returns(disclaimer); _controller.Index(); A.CallTo(() => _disclaimerViewModelBuilder.BuildDisclaimerViewModel(disclaimer)).MustHaveHappened(Repeated.Exactly.Once); }
public virtual ActionResult Index() { var disclaimer = _queryDispatcher.Dispatch <DisclaimerByUserQuery, Disclaimer>(new DisclaimerByUserQuery() { AssessorDomainName = _userPrincipalProvider.CurrentUserName }); var model = _disclaimerViewModelBuilder.BuildDisclaimerViewModel(disclaimer); return(View(model)); }