Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
martyn-w committed Jan 9, 2025
1 parent 9de1bbd commit 1ded50e
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ public void Candidate_MapsCorrectly()
DegreeSubject = "Maths",
AddressPostcode = "KY11 9YU",
PhoneCallScheduledAt = DateTime.UtcNow,
CreationChannelSourceId = 222750003,
CreationChannelServiceId = 222750002,
CreationChannelActivityId = 222750001,
};

var candidate = request.Candidate;
Expand Down Expand Up @@ -200,6 +203,10 @@ public void Candidate_MapsCorrectly()
candidate.Qualifications.First().DegreeSubject.Should().Be(request.DegreeSubject);
candidate.Qualifications.First().TypeId.Should().Be(request.DegreeTypeId);

candidate.ContactChannelCreations.First().CreationChannelSourceId.Should().Be(request.CreationChannelSourceId);
candidate.ContactChannelCreations.First().CreationChannelServiceId.Should().Be(request.CreationChannelServiceId);
candidate.ContactChannelCreations.First().CreationChannelActivityId.Should().Be(request.CreationChannelActivityId);

candidate.HasTeacherTrainingAdviserSubscription.Should().BeTrue();
}

Expand Down Expand Up @@ -280,6 +287,25 @@ public void Candidate_ChannelIdWhenCandidateIdIsNotNull_IsNotChanged()
request.Candidate.ChannelId.Should().BeNull();
request.Candidate.ChangedPropertyNames.Should().NotContain("ChannelId");
}

[Fact]
public void Candidate_ContactChannelCreationWhenCandidateIdIsNotNull()
{
var request = new TeacherTrainingAdviserSignUp()
{
CandidateId = Guid.NewGuid(),
CreationChannelSourceId = 222750000,
CreationChannelServiceId = 222750001,
CreationChannelActivityId = 222750002,
};

request.Candidate.ChannelId.Should().BeNull();
request.Candidate.ChangedPropertyNames.Should().NotContain("ChannelId");
request.Candidate.ChangedPropertyNames.Should().Contain("ContactChannelCreations");
request.Candidate.ContactChannelCreations.First().CreationChannelSourceId.Should().Be(222750000);
request.Candidate.ContactChannelCreations.First().CreationChannelServiceId.Should().Be(222750001);
request.Candidate.ContactChannelCreations.First().CreationChannelActivityId.Should().Be(222750002);
}

[Fact]
public void Candidate_WhenChannelIsProvided_SetsOnAllModels()
Expand Down

0 comments on commit 1ded50e

Please sign in to comment.