Ejemplo n.º 1
0
        public void ReturnContactDetailsInResidentResponse()
        {
            var domain = new ResidentDomain
            {
                Id          = 1234,
                FirstName   = "Name",
                LastName    = "Last",
                DateOfBirth = new DateTime(),
                Gender      = GenderTypeEnum.F,
                Contacts    = new List <ContactDetailsDomain>
                {
                    new ContactDetailsDomain
                    {
                        Id      = 1234,
                        AddedBy = "Test"
                    }
                }
            };

            var expectedResponse = new ResidentResponse
            {
                Id                 = 1234,
                FirstName          = "Name",
                LastName           = "Last",
                DateOfBirth        = new DateTime(),
                Gender             = "F",
                ContactInformation = new List <ContactDetailsResponse>
                {
                    new ContactDetailsResponse
                    {
                        Id      = 1234,
                        AddedBy = "Test"
                    }
                }
            };

            domain.ToResponse().Should().BeEquivalentTo(expectedResponse);
        }
Ejemplo n.º 2
0
        public void CanMapResidentInformationFromDomainToResponse()
        {
            var domain = new ResidentDomain
            {
                Id          = 1234,
                FirstName   = "Name",
                LastName    = "Last",
                DateOfBirth = new DateTime(),
                Gender      = GenderTypeEnum.F,
                Contacts    = null
            };

            var expectedResponse = new ResidentResponse
            {
                Id                 = 1234,
                FirstName          = "Name",
                LastName           = "Last",
                DateOfBirth        = new DateTime(),
                Gender             = "F",
                ContactInformation = null
            };

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