From 27873e7def6b9b04e625e241b84b19012ee1003e Mon Sep 17 00:00:00 2001 From: Denis-Cosmin Nutiu Date: Sat, 18 Apr 2020 14:17:54 +0300 Subject: [PATCH] Extract implementations from NucuCar.Domain in NucuCar.Common --- NucuCar.Common/NucuCar.Common.csproj | 7 +++++++ .../Utilities/ConnectionStringParser.cs | 2 +- {NucuCar.Domain => NucuCar.Common/Utilities}/Guard.cs | 2 +- NucuCar.Telemetry/NucuCar.Telemetry.csproj | 1 + NucuCar.Telemetry/TelemetryPublisherDisk.cs | 2 +- NucuCar.Telemetry/TelemetryPublisherFactory.cs | 2 +- NucuCar.Telemetry/TelemetryPublisherFirestore.cs | 2 +- .../Utilities/ConnectionStringParserTest.cs | 2 +- NucuCar.sln | 6 ++++++ 9 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 NucuCar.Common/NucuCar.Common.csproj rename {NucuCar.Domain => NucuCar.Common}/Utilities/ConnectionStringParser.cs (97%) rename {NucuCar.Domain => NucuCar.Common/Utilities}/Guard.cs (97%) diff --git a/NucuCar.Common/NucuCar.Common.csproj b/NucuCar.Common/NucuCar.Common.csproj new file mode 100644 index 0000000..42cf6aa --- /dev/null +++ b/NucuCar.Common/NucuCar.Common.csproj @@ -0,0 +1,7 @@ + + + + netcoreapp3.0;netcoreapp3.1 + + + diff --git a/NucuCar.Domain/Utilities/ConnectionStringParser.cs b/NucuCar.Common/Utilities/ConnectionStringParser.cs similarity index 97% rename from NucuCar.Domain/Utilities/ConnectionStringParser.cs rename to NucuCar.Common/Utilities/ConnectionStringParser.cs index 30d5362..040286e 100644 --- a/NucuCar.Domain/Utilities/ConnectionStringParser.cs +++ b/NucuCar.Common/Utilities/ConnectionStringParser.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace NucuCar.Domain.Utilities +namespace NucuCar.Common.Utilities { /// /// ConnectionStringParser is an utility service to parse and validate connection strings. diff --git a/NucuCar.Domain/Guard.cs b/NucuCar.Common/Utilities/Guard.cs similarity index 97% rename from NucuCar.Domain/Guard.cs rename to NucuCar.Common/Utilities/Guard.cs index b12ff78..b84ded9 100644 --- a/NucuCar.Domain/Guard.cs +++ b/NucuCar.Common/Utilities/Guard.cs @@ -1,6 +1,6 @@ using System; -namespace NucuCar.Domain +namespace NucuCar.Common.Utilities { /// /// Helper class used for checking arguments and raise exception if the checks don't pass. diff --git a/NucuCar.Telemetry/NucuCar.Telemetry.csproj b/NucuCar.Telemetry/NucuCar.Telemetry.csproj index d731bc7..72c5c96 100644 --- a/NucuCar.Telemetry/NucuCar.Telemetry.csproj +++ b/NucuCar.Telemetry/NucuCar.Telemetry.csproj @@ -5,6 +5,7 @@ + diff --git a/NucuCar.Telemetry/TelemetryPublisherDisk.cs b/NucuCar.Telemetry/TelemetryPublisherDisk.cs index 380d401..c2e93f7 100644 --- a/NucuCar.Telemetry/TelemetryPublisherDisk.cs +++ b/NucuCar.Telemetry/TelemetryPublisherDisk.cs @@ -6,8 +6,8 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Newtonsoft.Json; +using NucuCar.Common.Utilities; using NucuCar.Domain.Telemetry; -using NucuCar.Domain.Utilities; namespace NucuCar.Telemetry { diff --git a/NucuCar.Telemetry/TelemetryPublisherFactory.cs b/NucuCar.Telemetry/TelemetryPublisherFactory.cs index 868e2d3..ccddcf9 100644 --- a/NucuCar.Telemetry/TelemetryPublisherFactory.cs +++ b/NucuCar.Telemetry/TelemetryPublisherFactory.cs @@ -1,6 +1,6 @@ using System; using Microsoft.Extensions.Logging; -using NucuCar.Domain; +using NucuCar.Common.Utilities; using NucuCar.Domain.Telemetry; namespace NucuCar.Telemetry diff --git a/NucuCar.Telemetry/TelemetryPublisherFirestore.cs b/NucuCar.Telemetry/TelemetryPublisherFirestore.cs index a1b0246..a86d778 100644 --- a/NucuCar.Telemetry/TelemetryPublisherFirestore.cs +++ b/NucuCar.Telemetry/TelemetryPublisherFirestore.cs @@ -8,8 +8,8 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Newtonsoft.Json; +using NucuCar.Common.Utilities; using NucuCar.Domain.Telemetry; -using NucuCar.Domain.Utilities; namespace NucuCar.Telemetry { diff --git a/NucuCar.UnitTests/NucuCar.Domain.Tests/Utilities/ConnectionStringParserTest.cs b/NucuCar.UnitTests/NucuCar.Domain.Tests/Utilities/ConnectionStringParserTest.cs index 93d9989..7858881 100644 --- a/NucuCar.UnitTests/NucuCar.Domain.Tests/Utilities/ConnectionStringParserTest.cs +++ b/NucuCar.UnitTests/NucuCar.Domain.Tests/Utilities/ConnectionStringParserTest.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using NucuCar.Domain.Utilities; +using NucuCar.Common.Utilities; using Xunit; namespace NucuCar.UnitTests.NucuCar.Domain.Tests.Utilities diff --git a/NucuCar.sln b/NucuCar.sln index 0c4e409..a1fdcf5 100644 --- a/NucuCar.sln +++ b/NucuCar.sln @@ -10,6 +10,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NucuCar.UnitTests", "NucuCa EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NucuCar.Telemetry", "NucuCar.Telemetry\NucuCar.Telemetry.csproj", "{C20407F3-AB62-4590-B4FF-A0DCFCFA232B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NucuCar.Common", "NucuCar.Common\NucuCar.Common.csproj", "{C2C40BF1-2375-4C74-938E-652CC3C31BDD}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -36,5 +38,9 @@ Global {C20407F3-AB62-4590-B4FF-A0DCFCFA232B}.Debug|Any CPU.Build.0 = Debug|Any CPU {C20407F3-AB62-4590-B4FF-A0DCFCFA232B}.Release|Any CPU.ActiveCfg = Release|Any CPU {C20407F3-AB62-4590-B4FF-A0DCFCFA232B}.Release|Any CPU.Build.0 = Release|Any CPU + {C2C40BF1-2375-4C74-938E-652CC3C31BDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C2C40BF1-2375-4C74-938E-652CC3C31BDD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C2C40BF1-2375-4C74-938E-652CC3C31BDD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C2C40BF1-2375-4C74-938E-652CC3C31BDD}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal