public void IdentifyByNameAndAddress()
        {
            // Arrange
            var identification = new IdentifyModel
            {
                FullName = "Testulf testesen",
                AddressLine1 = "Vegen bortafor vegen",
                PostalCode = "0401",
                City = "Mordor"
            };
            var identificationResult = new IdentificationResult(IdentificationResultType.DigipostAddress,
                DigipostAddress);
            var controller = IdentifyControllerWithMockedDigipostServiceAndSessionState(identificationResult);

            // Act
            var result = controller.IdentifyByNameAndAddress(identification).Result as PartialViewResult;

            // Assert
            Assert.IsNotNull(result);
            var viewName = result.ViewName;
            Assert.AreEqual("IdentificationResult", viewName);
            Assert.IsInstanceOfType(result.Model, typeof (IdentificationResult));
            var viewModel = result.Model as IdentificationResult;
            Assert.AreEqual(DigipostAddress, viewModel.Data);
        }
 public async Task<ActionResult> IdentifyByNameAndAddress(IdentifyModel identifyModel)
 {
     var identification = new Identification(new RecipientByNameAndAddress(identifyModel.FullName, identifyModel.AddressLine1, identifyModel.PostalCode, identifyModel.City));
     
     var result = await _digipostService.Identify(identification);
     
     return PartialView("IdentificationResult", result);
 }
        public async Task<ActionResult> IdentifyById(IdentifyModel identifyModel)
        {
            var identification = new Identification(new RecipientById(identifyModel.IdentificationType, identifyModel.IdentificationValue));
            
            var result = await _digipostService.Identify(identification);

            return PartialView("IdentificationResult", result);
        }
        public void Identify()
        {
            // Arrange
            var identification = new IdentifyModel
            {
                IdentificationType = IdentificationType.DigipostAddress,
                IdentificationValue = DigipostAddress
            };
            var identificationResult = new IdentificationResult(IdentificationResultType.DigipostAddress,
                DigipostAddress);
            var controller = IdentifyControllerWithMockedDigipostServiceAndSessionState(identificationResult);

            // Act
            var result = controller.IdentifyById(identification).Result as PartialViewResult;

            // Assert
            Assert.IsNotNull(result);
            var viewName = result.ViewName;
            Assert.AreEqual("IdentificationResult", viewName);
            Assert.IsInstanceOfType(result.Model, typeof (IdentificationResult));
            var viewModel = result.Model as IdentificationResult;
            Assert.AreEqual(DigipostAddress, viewModel.Data);
        }