public void ResidentInformationIncludesRequiredProperties()
        {
            var phoneNumber = new HousingPhone()
            {
                PhoneNumber = "1234567890",
                PhoneType   = HousingPhoneTypeEnum.H
            };

            var address = new HousingAddress
            {
                AddressLine1 = "Address Line 1",
                PropertyRef  = "my property ref",
                PostCode     = "AB1 2BC",
            };

            var residentInformation = new HousingResidentInformation
            {
                FirstName   = "First",
                LastName    = "Last",
                Uprn        = "abc123",
                DateOfBirth = "1980-10-02",
                PhoneNumber = new List <HousingPhone> {
                    phoneNumber
                },
                Address = address,
            };

            residentInformation.FirstName.Should().Be("First");
            residentInformation.LastName.Should().Be("Last");
            residentInformation.Uprn.Should().Be("abc123");
            residentInformation.DateOfBirth.Should().Be("1980-10-02");
            residentInformation.PhoneNumber.Should().Contain(phoneNumber);
            residentInformation.Address.Should().BeEquivalentTo(address);
        }
Esempio n. 2
0
 private static Boundary.Responses.Phone ToResponse(this HousingPhone phoneNumber)
 {
     return(new Boundary.Responses.Phone
     {
         PhoneNumber = phoneNumber.PhoneNumber,
         PhoneType = phoneNumber.PhoneType.ToResponse(),
     });
 }
Esempio n. 3
0
        private static void UpdatePhone(Housing item, int order, string phone)
        {
            var housingPhone = item.Phones.SingleOrDefault(x => x.Order == order);

            if (housingPhone != null)
            {
                housingPhone.Number = phone;
            }
            else if (!string.IsNullOrEmpty(phone))
            {
                housingPhone = new HousingPhone {
                    Number = phone, Order = order
                };
                item.Phones.Add(housingPhone);
            }
        }