public void CanMapMosaicInformationWithOnlyPersonalInformationFromDomainToResponse()
        {
            var domain = new MosaicResidentInformation
            {
                MosaicId    = "123",
                FirstName   = "First",
                LastName    = "Last",
                Uprn        = "100000000",
                DateOfBirth = "01/01/2001",
                AddressList = null,
                PhoneNumber = null,
                NhsNumber   = "2000000000"
            };

            var expectedResponse = new MosaicResidentInformationResponse
            {
                MosaicId    = "123",
                FirstName   = "First",
                LastName    = "Last",
                Uprn        = "100000000",
                DateOfBirth = "01/01/2001",
                AddressList = null,
                PhoneNumber = null,
                NhsNumber   = "2000000000"
            };

            domain.ToResponse().Should().BeEquivalentTo(expectedResponse);
        }
        public void CanMapMosaicInformationFromDomainToResponse()
        {
            var domain = new MosaicResidentInformation
            {
                MosaicId    = "123",
                FirstName   = "First",
                LastName    = "Last",
                Uprn        = "100000000",
                DateOfBirth = "01/01/2001",
                PhoneNumber = new List <Phone>
                {
                    new Phone()
                    {
                        PhoneNumber = "07894564561",
                        PhoneType   = PhoneType.Home.ToString()
                    }
                },
                AddressList = new List <Address>
                {
                    new Address
                    {
                        AddressLine1 = "addess11",
                        AddressLine2 = "address22",
                        AddressLine3 = "address33",
                        PostCode     = "Postcode"
                    }
                },
                NhsNumber = "2000000000"
            };

            var expectedResponse = new MosaicResidentInformationResponse
            {
                MosaicId    = "123",
                FirstName   = "First",
                LastName    = "Last",
                Uprn        = "100000000",
                DateOfBirth = "01/01/2001",
                PhoneNumber = new List <PhoneNumberResponse>
                {
                    new PhoneNumberResponse
                    {
                        PhoneNumber = "07894564561",
                        PhoneType   = PhoneTypeResponse.Home
                    }
                },
                AddressList = new List <AddressResponse>
                {
                    new AddressResponse
                    {
                        AddressLine1 = "addess11",
                        AddressLine2 = "address22",
                        AddressLine3 = "address33",
                        PostCode     = "Postcode"
                    }
                },
                NhsNumber = "2000000000"
            };

            domain.ToResponse().Should().BeEquivalentTo(expectedResponse);
        }
Beispiel #3
0
 public static MosaicResidentInformationResponse ToResponse(this MosaicResidentInformation domain)
 {
     return(new MosaicResidentInformationResponse
     {
         MosaicId = domain.MosaicId,
         FirstName = domain.FirstName,
         LastName = domain.LastName,
         Uprn = domain.Uprn,
         DateOfBirth = domain.DateOfBirth,
         PhoneNumber = domain.PhoneNumber?.ToResponse(),
         AddressList = domain.AddressList?.ToResponse(),
         NhsNumber = domain.NhsNumber
     });
 }