Skip to content

Commit

Permalink
Merge pull request #291 from DFE-Digital/chore/constants
Browse files Browse the repository at this point in the history
SonarCloud suggestions: use constants instead of repeated string literals.
  • Loading branch information
RobertGHippo authored Aug 6, 2024
2 parents 07ad7fe + 665709a commit 7ac31a9
Show file tree
Hide file tree
Showing 7 changed files with 271 additions and 216 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ namespace Dfe.EarlyYearsQualification.Content.Constants;

public static class AwardingOrganisations
{
// ReSharper disable once IdentifierTypo
public const string Edexcel = "Edexcel (now Pearson Education Ltd)";

public const string Pearson = "Pearson Education Ltd";

// ReSharper disable once IdentifierTypo
public const string Ncfe = "NCFE";

public const string Cache = "CACHE Council for Awards in Care Health and Education";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,32 @@ namespace Dfe.EarlyYearsQualification.Mock.Content;

public class MockContentfulFilterService : IContentFilterService
{
public Task<List<Qualification>> GetFilteredQualifications(int? level, int? startDateMonth, int? startDateYear, string? awardingOrganisation, string? qualificationName)
public Task<List<Qualification>> GetFilteredQualifications(int? level, int? startDateMonth, int? startDateYear,
string? awardingOrganisation, string? qualificationName)
{
const string startDate = "Sep-14";
const string endDate = "Aug-19";

var qualifications =
new List<Qualification>
{
CreateQualification("EYQ-100", "CACHE", 2, null, "Aug-19"),
CreateQualification("EYQ-101", "NCFE", 2, "Sep-14", "Aug-19"),
CreateQualification("EYQ-240", "Pearson", 3, "Sep-14", "Aug-19"),
CreateQualification("EYQ-103", "NCFE", 3, "Sep-14", "Aug-19"),
CreateQualification("EYQ-104", "City & Guilds", 4, "Sep-14", "Aug-19"),
CreateQualification("EYQ-105", "Montessori Centre International", 4, "Sep-14", "Aug-19"),
CreateQualification("EYQ-106", AwardingOrganisations.Various, 5, "Sep-14", "Aug-19"),
CreateQualification("EYQ-107", "Edexcel (now Pearson Education Ltd)", 5, "Sep-14", "Aug-19"),
CreateQualification("EYQ-108", "Kent Sussex Montessori Centre", 6, "Sep-14", "Aug-19"),
CreateQualification("EYQ-109", "NNEB National Nursery Examination Board", 6, "Sep-14", "Aug-19"),
CreateQualification("EYQ-110", AwardingOrganisations.Various, 7, "Sep-14", "Aug-19"),
CreateQualification("EYQ-111", "City & Guilds", 7, "Sep-14", "Aug-19"),
CreateQualification("EYQ-112", "Pearson", 8, "Sep-14", "Aug-19"),
CreateQualification("EYQ-113", "CACHE", 8, "Sep-14", "Aug-19")
CreateQualification("EYQ-100", AwardingOrganisations.Cache, 2, null, endDate),
CreateQualification("EYQ-101", AwardingOrganisations.Ncfe, 2, startDate, endDate),
CreateQualification("EYQ-240", AwardingOrganisations.Pearson, 3, startDate, endDate),
CreateQualification("EYQ-103", AwardingOrganisations.Ncfe, 3, startDate, endDate),
CreateQualification("EYQ-104", "City & Guilds", 4, startDate, endDate),
CreateQualification("EYQ-105", "Montessori Centre International", 4, startDate, endDate),
CreateQualification("EYQ-106", AwardingOrganisations.Various, 5, startDate, endDate),
CreateQualification("EYQ-107", AwardingOrganisations.Edexcel, 5, startDate, endDate),
CreateQualification("EYQ-108", "Kent Sussex Montessori Centre", 6, startDate, endDate),
CreateQualification("EYQ-109", "NNEB National Nursery Examination Board", 6, startDate, endDate),
CreateQualification("EYQ-110", AwardingOrganisations.Various, 7, startDate, endDate),
CreateQualification("EYQ-111", "City & Guilds", 7, startDate, endDate),
CreateQualification("EYQ-112", AwardingOrganisations.Pearson, 8, startDate, endDate),
CreateQualification("EYQ-113", AwardingOrganisations.Cache, 8, startDate, endDate)
};

// For now, inbound parameters startDateMonth and startDateYear are ignored
return Task.FromResult(qualifications.Where(x => x.QualificationLevel == level).ToList());
}

Expand Down
Loading

0 comments on commit 7ac31a9

Please sign in to comment.