Skip to content

Commit

Permalink
Merge pull request #4683 from dfe-analytical-services/EES-5022
Browse files Browse the repository at this point in the history
EES-5022 Give AcademicYear identifier precedence over '* term' identi…
  • Loading branch information
mmyoungman authored Mar 21, 2024
2 parents d3e7a31 + 275488e commit 254c475
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ namespace GovUk.Education.ExploreEducationStatistics.Common.Model
[SuppressMessage("ReSharper", "UnusedMember.Global")]
public enum TimeIdentifier
{
[TimeIdentifierMeta("Autumn term", "T1", Term, Academic)]
AutumnTerm,

[TimeIdentifierMeta("Spring term", "T2", Term, Academic)]
SpringTerm,

[TimeIdentifierMeta("Autumn and spring term", "T1T2", Term, Academic)]
AutumnSpringTerm,

[TimeIdentifierMeta("Summer term", "T3", Term, Academic)]
SummerTerm,

[TimeIdentifierMeta("Academic year", "AY", Category.AcademicYear, Academic, NoLabel)]
AcademicYear,

Expand Down Expand Up @@ -82,18 +94,6 @@ public enum TimeIdentifier
[TimeIdentifierMeta("Reporting year", "RY", Category.ReportingYear, Default, NoLabel)]
ReportingYear,

[TimeIdentifierMeta("Autumn term", "T1", Term, Academic)]
AutumnTerm,

[TimeIdentifierMeta("Autumn and spring term", "T1T2", Term, Academic)]
AutumnSpringTerm,

[TimeIdentifierMeta("Spring term", "T2", Term, Academic)]
SpringTerm,

[TimeIdentifierMeta("Summer term", "T3", Term, Academic)]
SummerTerm,

[TimeIdentifierMeta("Week 1", "W1", Week)]
Week1,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ public void GetTermsReturnsTerms()
Assert.Equal(new[]
{
AutumnTerm,
AutumnSpringTerm,
SpringTerm,
AutumnSpringTerm,
SummerTerm
}, TimeIdentifierUtil.GetTerms());
}
Expand All @@ -168,4 +168,4 @@ public void GetFinancialYearPartsReturnsFinancialYearParts()
}, TimeIdentifierUtil.GetFinancialYearParts());
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -561,24 +561,24 @@ public void RangeIsGeneratedForTermQuery()
new List<(int Year, TimeIdentifier TimeIdentifier)>
{
(2019, AutumnTerm),
(2019, AutumnSpringTerm),
(2019, SpringTerm),
(2019, AutumnSpringTerm),
(2019, SummerTerm)
},
TimePeriodUtil.Range(new TimePeriodQuery(2019, AutumnTerm, 2019, SummerTerm)).ToList());

CollectionAssert.AreEquivalent(
new List<(int Year, TimeIdentifier TimeIdentifier)>
{
(2018, SpringTerm),
(2018, AutumnSpringTerm),
(2018, SummerTerm),
(2019, AutumnTerm),
(2019, AutumnSpringTerm),
(2019, SpringTerm),
(2019, AutumnSpringTerm),
(2019, SummerTerm),
(2020, AutumnTerm)
},
TimePeriodUtil.Range(new TimePeriodQuery(2018, SpringTerm, 2020, AutumnTerm)).ToList());
TimePeriodUtil.Range(new TimePeriodQuery(2018, AutumnSpringTerm, 2020, AutumnTerm)).ToList());
}

[Fact]
Expand Down Expand Up @@ -609,4 +609,4 @@ public void RangeIsGeneratedForFinancialYearPartQuery()
TimePeriodUtil.Range(new TimePeriodQuery(2020, FinancialYearPart1, 2021, FinancialYearPart1)).ToList());
}
}
}
}

0 comments on commit 254c475

Please sign in to comment.