From 6aaf5b39ad30882e0d2e60989aa96acccd14ec81 Mon Sep 17 00:00:00 2001 From: Marek Matulka Date: Mon, 23 Sep 2024 11:54:50 +0100 Subject: [PATCH] DP-613: Clean up to match the selected coding convention --- .../UseCase/GetFormSectionQuestionsUseCaseTest.cs | 12 ++++++------ .../DatabaseShareCodeRepositoryTest.cs | 10 +++++----- .../Factories/SharedConsentFactory.cs | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Services/CO.CDP.Forms.WebApi.Tests/UseCase/GetFormSectionQuestionsUseCaseTest.cs b/Services/CO.CDP.Forms.WebApi.Tests/UseCase/GetFormSectionQuestionsUseCaseTest.cs index a3d3b0843..7fcf7a5a9 100644 --- a/Services/CO.CDP.Forms.WebApi.Tests/UseCase/GetFormSectionQuestionsUseCaseTest.cs +++ b/Services/CO.CDP.Forms.WebApi.Tests/UseCase/GetFormSectionQuestionsUseCaseTest.cs @@ -12,13 +12,13 @@ public class GetFormSectionQuestionsUseCaseTest(AutoMapperFixture mapperFixture) private readonly Mock _repository = new(); private GetFormSectionQuestionsUseCase UseCase => new(_repository.Object, mapperFixture.Mapper); - private static int nextQuestionNumber = 0; + private static int _nextQuestionNumber; - private static int getQuestionNumber() + private static int GetQuestionNumber() { - Interlocked.Increment(ref nextQuestionNumber); + Interlocked.Increment(ref _nextQuestionNumber); - return nextQuestionNumber; + return _nextQuestionNumber; } [Fact] @@ -76,7 +76,7 @@ public async Task ItReturnsTheSectionWithQuestions() Id = 1, Guid = Guid.NewGuid(), Caption = "Page caption", - Name = "_Section0" + getQuestionNumber(), + Name = "_Section0" + GetQuestionNumber(), Title = "The financial information you will need.", Description = "You will need to upload accounts or statements for your 2 most recent financial years. If you do not have 2 years, you can upload your most recent financial year. You will need to enter the financial year end date for the information you upload.", Type = CO.CDP.OrganisationInformation.Persistence.Forms.FormQuestionType.NoInput, @@ -91,7 +91,7 @@ public async Task ItReturnsTheSectionWithQuestions() Id = 2, Guid = Guid.NewGuid(), Caption = "Page caption", - Name = "_Section0" + getQuestionNumber(), + Name = "_Section0" + GetQuestionNumber(), Title = "Were your accounts audited?.", Description = "", Type = CO.CDP.OrganisationInformation.Persistence.Forms.FormQuestionType.YesOrNo, diff --git a/Services/CO.CDP.OrganisationInformation.Persistence.Tests/DatabaseShareCodeRepositoryTest.cs b/Services/CO.CDP.OrganisationInformation.Persistence.Tests/DatabaseShareCodeRepositoryTest.cs index b23207556..d0e5ac45f 100644 --- a/Services/CO.CDP.OrganisationInformation.Persistence.Tests/DatabaseShareCodeRepositoryTest.cs +++ b/Services/CO.CDP.OrganisationInformation.Persistence.Tests/DatabaseShareCodeRepositoryTest.cs @@ -6,13 +6,13 @@ namespace CO.CDP.OrganisationInformation.Persistence.Tests; public class DatabaseShareCodeRepositoryTest(PostgreSqlFixture postgreSql) : IClassFixture { - private static int nextQuestionNumber = 0; + private static int _nextQuestionNumber; - private static int getQuestionNumber() + private static int GetQuestionNumber() { - Interlocked.Increment(ref nextQuestionNumber); + Interlocked.Increment(ref _nextQuestionNumber); - return nextQuestionNumber; + return _nextQuestionNumber; } [Fact] @@ -275,7 +275,7 @@ private static FormQuestion GivenYesOrNoQuestion(FormSection section) Section = section, Type = FormQuestionType.YesOrNo, IsRequired = true, - Name = "_Section0" + getQuestionNumber(), + Name = "_Section0" + GetQuestionNumber(), Title = "Yes or no?", Description = "Please answer.", NextQuestion = null, diff --git a/Services/CO.CDP.OrganisationInformation.Persistence.Tests/Factories/SharedConsentFactory.cs b/Services/CO.CDP.OrganisationInformation.Persistence.Tests/Factories/SharedConsentFactory.cs index 0f5b08873..e0b8c4534 100644 --- a/Services/CO.CDP.OrganisationInformation.Persistence.Tests/Factories/SharedConsentFactory.cs +++ b/Services/CO.CDP.OrganisationInformation.Persistence.Tests/Factories/SharedConsentFactory.cs @@ -7,13 +7,13 @@ namespace CO.CDP.OrganisationInformation.Persistence.Tests.Factories; public static class SharedConsentFactory { - private static int nextQuestionNumber = 0; + private static int _nextQuestionNumber; - private static int getQuestionNumber() + private static int GetQuestionNumber() { - Interlocked.Increment(ref nextQuestionNumber); + Interlocked.Increment(ref _nextQuestionNumber); - return nextQuestionNumber; + return _nextQuestionNumber; } public static SharedConsent GivenSharedConsent( @@ -96,7 +96,7 @@ public static FormQuestion GivenFormQuestion( var question = new FormQuestion { Guid = questionId ?? Guid.NewGuid(), - Name = "_Section0" + getQuestionNumber(), + Name = "_Section0" + GetQuestionNumber(), Title = "Were your accounts audited?", Caption = "", Description = "Please answer.",