public void GetVacancyQuestionsViewModelShouldGetViewmodelFromProvider() { const int vacancyReferenceNumber = 1; var vacancyProvider = new Mock <IVacancyQAProvider>(); var mediator = new VacancyMediatorBuilder().With(vacancyProvider).Build(); var viewModel = new VacancyQuestionsViewModel(); vacancyProvider.Setup(vp => vp.GetVacancyQuestionsViewModel(vacancyReferenceNumber)).Returns(viewModel); var result = mediator.GetVacancyQuestionsViewModel(vacancyReferenceNumber); result.AssertCodeAndMessage(VacancyMediatorCodes.GetVacancyQuestionsViewModel.Ok); vacancyProvider.Verify(vp => vp.GetVacancyQuestionsViewModel(vacancyReferenceNumber)); }