Skip to content

Commit

Permalink
Add test to ensure we're setting academies on Pupil numbers
Browse files Browse the repository at this point in the history
We weren't testing this before and it was affecting our mutation score
  • Loading branch information
dynamictulip committed Jan 23, 2025
1 parent 44027be commit 14f3e3f
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,24 @@ public void PhaseAndAgeRangeSortValue_should_be_amalgamation_of_Phase_and_age_ra
result.Should().Be(expected);
}

[Fact]
public async Task OnGetAsync_sets_academies_from_academyService()
{
var academy = new AcademyPupilNumbersServiceModel("", null, null, new AgeRange(5, 11), null, null);
var academies = new[]
{
academy with { Urn = "1" },
academy with { Urn = "2" },
academy with { Urn = "3" }
};
_mockAcademyService.Setup(a => a.GetAcademiesInTrustPupilNumbersAsync(TrustUid))
.ReturnsAsync(academies);

_ = await Sut.OnGetAsync();

Sut.Academies.Should().BeEquivalentTo(academies);
}

[Fact]
public override async Task OnGetAsync_should_configure_TrustPageMetadata_TabPageName()
{
Expand Down

0 comments on commit 14f3e3f

Please sign in to comment.