Exemple #1
0
        public async Task GetAppeal_returns_view_with_expected_viewModel()
        {
            var viewModel = new AppealViewModel {
                ApplicationSummary = new ApplicationSummaryViewModel {
                    ApplicationId = _applicationDetailsApplicationId
                }
            };

            _oversightOrchestrator.Setup(x => x.GetAppealDetailsViewModel(_applicationDetailsApplicationId, null)).ReturnsAsync(viewModel);

            var request = new AppealRequest()
            {
                ApplicationId = _applicationDetailsApplicationId
            };
            var result = await _controller.Appeal(request) as ViewResult;

            var actualViewModel = result?.Model as AppealViewModel;

            Assert.That(result, Is.Not.Null);
            Assert.That(actualViewModel, Is.Not.Null);
            Assert.That(actualViewModel, Is.SameAs(viewModel));
            Assert.AreEqual(_applicationDetailsApplicationId, actualViewModel.ApplicationSummary.ApplicationId);
        }
        public async Task Get_Appeal_Returns_View()
        {
            var request = new AppealRequest
            {
                ApplicationId = Guid.NewGuid()
            };

            _appealOrchestrator.Setup(x =>
                                      x.GetAppealViewModel(
                                          It.Is <AppealRequest>(r => r.ApplicationId == request.ApplicationId),
                                          It.IsAny <string>()))
            .ReturnsAsync(() => new AppealViewModel());

            var result = await _controller.Appeal(request);

            Assert.IsInstanceOf <ViewResult>(result);
        }