Skip to content

Commit

Permalink
add broken test for ContactChannelCreation
Browse files Browse the repository at this point in the history
  • Loading branch information
martyn-w committed Jan 9, 2025
1 parent 3a44630 commit 15f191c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions GetIntoTeachingApiTests/Services/CandidateUpserterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,28 @@ public void Upsert_WhenPrivacyPolicyIsNull_DoesNotUpsertPrivacyPolicy()
It.Is<Job>(job => job.Type == typeof(UpsertModelWithCandidateIdJob<CandidatePrivacyPolicy>)),
It.IsAny<EnqueuedState>()), Times.Never);
}

// FIXME: This new test is broken and needs fixing
[Fact]
public void Upsert_WithContactChannelCreation_SavesContactChannelCreations()
{
var candidateId = Guid.NewGuid();
var contactChannelCreation = new ContactChannelCreation {
CreationChannelActivityId = 222750000,
CreationChannelServiceId = 222750001,
CreationChannelSourceId = 222750002,
};

_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);
}


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

0 comments on commit 15f191c

Please sign in to comment.