Skip to content

Commit

Permalink
Corrected verification on Upsert_WithContactChannelCreation_SavesCont…
Browse files Browse the repository at this point in the history
…actChannelCreations test
  • Loading branch information
spencerohegartyDfE committed Jan 13, 2025
1 parent 15f191c commit 95275ce
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions GetIntoTeachingApiTests/Services/CandidateUpserterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ public void Upsert_WhenPrivacyPolicyIsNull_DoesNotUpsertPrivacyPolicy()
It.IsAny<EnqueuedState>()), Times.Never);
}

// FIXME: This new test is broken and needs fixing
[Fact]
public void Upsert_WithContactChannelCreation_SavesContactChannelCreations()
{
Expand All @@ -277,15 +276,16 @@ public void Upsert_WithContactChannelCreation_SavesContactChannelCreations()
};

_candidate.ContactChannelCreations.Add(contactChannelCreation);
_mockCrm.Setup(mock => mock.Save(It.IsAny<Candidate>())).Callback<BaseModel>(c => c.Id = candidateId);

_upserter.Upsert(_candidate);

contactChannelCreation.CandidateId = candidateId;

_mockCrm.Verify(mock => mock.Save(It.Is<ContactChannelCreation>(q => q.CandidateId == candidateId)), Times.Once);
}

_mockJobClient.Verify(backgroundJobClient =>
backgroundJobClient.Create(
It.Is<Job>(job => job.Type == typeof(UpsertModelWithCandidateIdJob<ContactChannelCreation>)),
It.IsAny<EnqueuedState>()), Times.Once);
}

private static bool IsMatch(object objectA, object objectB)
{
Expand Down

0 comments on commit 95275ce

Please sign in to comment.