コード例 #1
0
 public static AcademyClaimantInformationResponse ToResponse(this AcademyClaimantInformation claimants)
 {
     return(new AcademyClaimantInformationResponse
     {
         ClaimId = claimants.ClaimId,
         PersonRef = claimants.PersonRef,
         FirstName = claimants.FirstName,
         LastName = claimants.LastName,
         DateOfBirth = claimants.DateOfBirth,
         NINumber = claimants.NINumber,
         ClaimantAddress = claimants.ClaimantAddress.ToResponse(),
         CheckDigit = claimants.CheckDigit
     });
 }
コード例 #2
0
        public void CanMapAcademyInformationFromDomainToResponse()
        {
            var domain = new AcademyClaimantInformation
            {
                ClaimId         = 123,
                PersonRef       = 456,
                FirstName       = "First",
                LastName        = "Last",
                DateOfBirth     = "01/01/2001",
                NINumber        = "NI123456N",
                ClaimantAddress = new Address
                {
                    AddressLine1 = "addess11",
                    AddressLine2 = "address22",
                    AddressLine3 = "address33",
                    PostCode     = "Postcode"
                },
                CheckDigit = "Digit"
            };

            var expectedResponse = new AcademyClaimantInformationResponse
            {
                ClaimId         = 123,
                PersonRef       = 456,
                FirstName       = "First",
                LastName        = "Last",
                DateOfBirth     = "01/01/2001",
                NINumber        = "NI123456N",
                ClaimantAddress = new AddressResponse
                {
                    AddressLine1 = "addess11",
                    AddressLine2 = "address22",
                    AddressLine3 = "address33",
                    PostCode     = "Postcode"
                },
                CheckDigit = "Digit"
            };

            domain.ToResponse().Should().BeEquivalentTo(expectedResponse);
        }