Exemplo n.º 1
0
        public void WhenMashResidentAndMatchingPersonExistUpdatesSocialCareIdValueOnMashResident()
        {
            var personMatch = TestHelpers.CreatePerson();

            DatabaseContext.Persons.Add(personMatch);
            DatabaseContext.SaveChanges();

            var mashReferral = MashReferralHelper.SaveMashReferralToDatabase(DatabaseContext, "CONTACT");
            var mashResident = MashResidentHelper.SaveMashResidentToDatabase(DatabaseContext, mashReferral.Id, null);

            mashResident.SocialCareId.Should().BeNull();

            var request = TestHelpers.CreateMashResidentUpdateRequest(personMatch.Id);

            var response = _mashReferralGateway.UpdateMashResident(request, mashResident.Id);

            response.Should().BeEquivalentTo(mashResident.ToDomain());
            response.SocialCareId.Should().Be(personMatch.Id);
        }
        public MashResidentResponse UpdateMashResident(UpdateMashResidentRequest request, long mashResidentId)
        {
            var response = _mashReferralGateway.UpdateMashResident(request, mashResidentId);

            return(response.ToResponse());
        }