public void Arrange()
        {
            var certificateAddressController = new CertificateAddressController(MockedLogger.Object, MockHttpContextAccessor.Object, ApiClient);

            _result = certificateAddressController.Address(Certificate.Id).GetAwaiter().GetResult();

            var result = _result as ViewResult;

            _viewModelResponse = result.Model as CertificateAddressViewModel;
        }
Example #2
0
        public async Task Then_LoadsAddressView(CertificateSession session)
        {
            session.CertificateId = CertificateIdWithPreviousAddress;
            var sessionString = JsonConvert.SerializeObject(session);

            _mockSessionService.Setup(s => s.Get(nameof(CertificateSession))).Returns(sessionString);

            var result = await _certificateAddressController.Address() as ViewResult;

            result.ViewName.Should().Be("~/Views/Certificate/Address.cshtml");
            result.Model.Should().BeOfType <CertificateAddressViewModel>();
        }