public async Task Then_Verify_ViewModel_Is_Mapped_From_Request(bool isTransfer) { //Arrange _chooseOrganisationRequest.transferConnectionCode = isTransfer ? _chooseOrganisationRequest.transferConnectionCode : string.Empty; //Act var result = await _controller.SelectLegalEntity(_chooseOrganisationRequest); //Assert var viewResult = result as ViewResult; var viewModel = viewResult.Model; Assert.IsInstanceOf <SelectLegalEntityViewModel>(viewModel); Assert.AreEqual(_selectLegalEntityViewModel, (SelectLegalEntityViewModel)viewModel); }