From 11ee9754b626372bff5ae040fc31a543c885fd50 Mon Sep 17 00:00:00 2001 From: adi latic Date: Wed, 22 Mar 2023 14:28:43 -0500 Subject: [PATCH 1/3] Create: O Tokenizations --- .../Services/Foundations/OQueries/OQueryServiceTests.cs | 2 +- .../OTokenizationOrchestrationService.Exceptions.cs | 6 +++--- .../OTokenizations/OTokenizationOrchestrationService.cs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/OData.Neo.Core.Tests.Unit/Services/Foundations/OQueries/OQueryServiceTests.cs b/OData.Neo.Core.Tests.Unit/Services/Foundations/OQueries/OQueryServiceTests.cs index b5cb16e..4b99a86 100644 --- a/OData.Neo.Core.Tests.Unit/Services/Foundations/OQueries/OQueryServiceTests.cs +++ b/OData.Neo.Core.Tests.Unit/Services/Foundations/OQueries/OQueryServiceTests.cs @@ -38,7 +38,7 @@ public static TheoryData DependencyExceptions() }; } - private static string GetRandomString() => + private static string CreateRandomString() => new MnemonicString().GetValue(); private static (List, string) GenerateRandomSqlQueryProperties() diff --git a/OData.Neo.Core.Tests.Unit/Services/Orchestrations/OTokenizations/OTokenizationOrchestrationService.Exceptions.cs b/OData.Neo.Core.Tests.Unit/Services/Orchestrations/OTokenizations/OTokenizationOrchestrationService.Exceptions.cs index ff62b38..6a87663 100644 --- a/OData.Neo.Core.Tests.Unit/Services/Orchestrations/OTokenizations/OTokenizationOrchestrationService.Exceptions.cs +++ b/OData.Neo.Core.Tests.Unit/Services/Orchestrations/OTokenizations/OTokenizationOrchestrationService.Exceptions.cs @@ -22,7 +22,7 @@ public void ShouldThrowDependencyValidationExceptionOnOTokenizeIfDependencyValid Xeption dependencyValidationException) { // given - string someQuery = GetRandomString(); + string someQuery = CreateRandomString(); var expectedOTokenizeOrchestrationDependencyValidationException = new OTokenizationOrchestrationDependencyValidationException( @@ -69,7 +69,7 @@ public void ShouldThrowDependencyExceptionOnOTokenizeIfDependencyErrorOccurs( Xeption dependencyException) { // given - string someQuery = GetRandomString(); + string someQuery = CreateRandomString(); var expectedOTokenizationOrchestrationDependencyException = new OTokenizationOrchestrationDependencyException( @@ -114,7 +114,7 @@ public void ShouldThrowDependencyExceptionOnOTokenizeIfDependencyErrorOccurs( public void ShouldThrowServiceExceptionOnOTokenizeIfServiceErrorOccurs() { // given - string someQuery = GetRandomString(); + string someQuery = CreateRandomString(); var serviceException = new Exception(); var failedTokenizationOrchestrationServiceException = diff --git a/OData.Neo.Core.Tests.Unit/Services/Orchestrations/OTokenizations/OTokenizationOrchestrationService.cs b/OData.Neo.Core.Tests.Unit/Services/Orchestrations/OTokenizations/OTokenizationOrchestrationService.cs index 6822157..f555d56 100644 --- a/OData.Neo.Core.Tests.Unit/Services/Orchestrations/OTokenizations/OTokenizationOrchestrationService.cs +++ b/OData.Neo.Core.Tests.Unit/Services/Orchestrations/OTokenizations/OTokenizationOrchestrationService.cs @@ -45,7 +45,7 @@ public OTokenizationOrchestrationServiceTests() public static TheoryData DependencyValidationExceptions() { - string randomMessage = GetRandomString(); + string randomMessage = CreateRandomString(); var someException = new Xeption(randomMessage); return new TheoryData @@ -58,7 +58,7 @@ public static TheoryData DependencyValidationExceptions() public static TheoryData DependencyExceptions() { - string randomMessage = GetRandomString(); + string randomMessage = CreateRandomString(); var someException = new Xeption(randomMessage); return new TheoryData @@ -92,7 +92,7 @@ private Expression> SameOTokensAs( private static OToken CreateRandomOToken() => CreateOTokenFiller().Create(); - private static string GetRandomString() => + private static string CreateRandomString() => new MnemonicString(wordCount: GetRandomCount()).GetValue(); private static int GetRandomCount() => From ced0b2d46d5a948041e97e3395e7eb7be566d4a8 Mon Sep 17 00:00:00 2001 From: adi latic Date: Wed, 22 Mar 2023 14:33:09 -0500 Subject: [PATCH 2/3] Create: O Tokenizations --- .../OTokenizations/OTokenizationOrchestrationService.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OData.Neo.Core.Tests.Unit/Services/Orchestrations/OTokenizations/OTokenizationOrchestrationService.cs b/OData.Neo.Core.Tests.Unit/Services/Orchestrations/OTokenizations/OTokenizationOrchestrationService.cs index f555d56..5117ae1 100644 --- a/OData.Neo.Core.Tests.Unit/Services/Orchestrations/OTokenizations/OTokenizationOrchestrationService.cs +++ b/OData.Neo.Core.Tests.Unit/Services/Orchestrations/OTokenizations/OTokenizationOrchestrationService.cs @@ -92,8 +92,10 @@ private Expression> SameOTokensAs( private static OToken CreateRandomOToken() => CreateOTokenFiller().Create(); - private static string CreateRandomString() => - new MnemonicString(wordCount: GetRandomCount()).GetValue(); + private static string CreateRandomString() + { + return new MnemonicString(wordCount: GetRandomCount()).GetValue(); + } private static int GetRandomCount() => new IntRange(min: 2, max: 10).GetValue(); From ee4490ddba5b739821037efbf725d87fc4f726eb Mon Sep 17 00:00:00 2001 From: adi latic Date: Wed, 22 Mar 2023 14:35:20 -0500 Subject: [PATCH 3/3] CODE RUB: Create String for OTokenization --- .../OTokenizations/OTokenizationOrchestrationService.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/OData.Neo.Core.Tests.Unit/Services/Orchestrations/OTokenizations/OTokenizationOrchestrationService.cs b/OData.Neo.Core.Tests.Unit/Services/Orchestrations/OTokenizations/OTokenizationOrchestrationService.cs index 5117ae1..b95a125 100644 --- a/OData.Neo.Core.Tests.Unit/Services/Orchestrations/OTokenizations/OTokenizationOrchestrationService.cs +++ b/OData.Neo.Core.Tests.Unit/Services/Orchestrations/OTokenizations/OTokenizationOrchestrationService.cs @@ -92,10 +92,7 @@ private Expression> SameOTokensAs( private static OToken CreateRandomOToken() => CreateOTokenFiller().Create(); - private static string CreateRandomString() - { - return new MnemonicString(wordCount: GetRandomCount()).GetValue(); - } + private static string CreateRandomString() => new MnemonicString(wordCount: GetRandomCount()).GetValue(); private static int GetRandomCount() => new IntRange(min: 2, max: 10).GetValue();