Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
martyn-w committed Jan 7, 2025
1 parent a819647 commit c40d416
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ public CandidateValidator(IStore store, IDateTimeProvider dateTime)
RuleFor(candidate => candidate.InitialTeacherTrainingYearId)
.SetValidator(new PickListItemIdValidator<Candidate>("contact", "dfe_ittyear", store))
.Unless(candidate => candidate.InitialTeacherTrainingYearId == null);
// RuleFor(candidate => candidate.ChannelId)
// .NotNull()
// .When(candidate => candidate.Id == null)
// .SetValidator(new PickListItemIdValidator<Candidate>("contact", "dfe_channelcreation", store));
RuleFor(candidate => candidate.ChannelId)
.NotNull()
.When(candidate => candidate.Id == null)
.When(candidate => !candidate.ContactChannelCreations.Any())
.SetValidator(new PickListItemIdValidator<Candidate>("contact", "dfe_channelcreation", store));
RuleFor(candidate => candidate.HasGcseEnglishId)
.SetValidator(new PickListItemIdValidator<Candidate>("contact", "dfe_websitehasgcseenglish", store))
.Unless(candidate => candidate.HasGcseEnglishId == null);
Expand Down
2 changes: 1 addition & 1 deletion GetIntoTeachingApiTests/Jobs/UpsertCandidateJobTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private static bool IsMatch(object objectA, object objectB)

private static string Signature(Candidate candidate)
{
var changedProperties = "MergedIsNewRegistrantTeachingEventRegistrationsQualificationsPastTeachingPositionsApplicationFormsSchoolExperiencesIdEmail";
var changedProperties = "MergedIsNewRegistrantTeachingEventRegistrationsQualificationsPastTeachingPositionsApplicationFormsSchoolExperiencesContactChannelCreationsIdEmail";
return $"{candidate.Id}-{candidate.Email}-{changedProperties}";
}
}
Expand Down

0 comments on commit c40d416

Please sign in to comment.