Beispiel #1
0
        public async Task And_ModelIsInvalid_Then_ReturnView(string type)
        {
            MergeController.ModelState.AddModelError("Error", "Error message");

            var viewModel = _autoFixture.Create <SearchOrganisationViewModel>();

            var result = await MergeController.EpaoSearchResults(type, null, viewModel) as ViewResult;

            result.Model.Should().BeEquivalentTo(viewModel);
        }
Beispiel #2
0
        public async Task And_UserIsNavigatingForwards_Then_SearchCommandIsAdded(string type)
        {
            SetUpApiResponse();

            var viewModel = _autoFixture.Create <SearchOrganisationViewModel>();

            await MergeController.EpaoSearchResults(type, null, viewModel);

            _mockMergeSessionService.Verify(ms => ms.AddSearchEpaoCommand(type, viewModel.SearchString), Times.Once());
        }
Beispiel #3
0
        public async Task Then_ResultsAreMapped(string type)
        {
            SetUpApiResponse();

            var searchViewModel = _autoFixture.Create <SearchOrganisationViewModel>();

            var result = await MergeController.EpaoSearchResults(type, true, searchViewModel) as ViewResult;

            var model = result.Model as EpaoSearchResultsViewModel;

            model.Results.Count.Should().Be(_response.Count);
        }