From 1ded50ed51a2b26e617e5060ef39d4ccc9df250c Mon Sep 17 00:00:00 2001 From: Martyn Whitwell Date: Thu, 9 Jan 2025 17:49:04 +0000 Subject: [PATCH] add tests --- .../TeacherTrainingAdviserSignUpTests.cs | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/GetIntoTeachingApiTests/Models/TeacherTrainingAdviser/TeacherTrainingAdviserSignUpTests.cs b/GetIntoTeachingApiTests/Models/TeacherTrainingAdviser/TeacherTrainingAdviserSignUpTests.cs index 42c0a9c00..424f149ea 100644 --- a/GetIntoTeachingApiTests/Models/TeacherTrainingAdviser/TeacherTrainingAdviserSignUpTests.cs +++ b/GetIntoTeachingApiTests/Models/TeacherTrainingAdviser/TeacherTrainingAdviserSignUpTests.cs @@ -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; @@ -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(); } @@ -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()