From 8f9962c3b143bb8f6f75b0355fec8fa4cff89795 Mon Sep 17 00:00:00 2001 From: Denis Nutiu Date: Sat, 1 Aug 2020 16:03:06 +0300 Subject: [PATCH] Merge NucuCar.Common with NucuCar.Domain --- NucuCar.Domain.Telemetry/TelemetryPublisherDisk.cs | 2 +- NucuCar.Domain.Telemetry/TelemetryPublisherFactory.cs | 2 +- NucuCar.Domain.Telemetry/TelemetryPublisherFirestore.cs | 4 ++-- {NucuCar.Common => NucuCar.Domain}/HttpClient.cs | 4 ++-- .../Utilities/ConnectionStringParser.cs | 2 +- {NucuCar.Common => NucuCar.Domain}/Utilities/Guard.cs | 2 +- NucuCar.Sensors/Properties/launchSettings.json | 2 +- .../NucuCar.Common.Tests/ConnectionStringParserTest.cs | 2 +- NucuCar.UnitTests/NucuCar.Common.Tests/MockHttpClient.cs | 4 ++-- .../TelemetryPublisherFirestoreTest.cs | 2 +- NucuCar.sln | 6 ------ NucuCar.sln.DotSettings | 2 ++ 12 files changed, 15 insertions(+), 19 deletions(-) rename {NucuCar.Common => NucuCar.Domain}/HttpClient.cs (99%) rename {NucuCar.Common => NucuCar.Domain}/Utilities/ConnectionStringParser.cs (97%) rename {NucuCar.Common => NucuCar.Domain}/Utilities/Guard.cs (97%) create mode 100644 NucuCar.sln.DotSettings diff --git a/NucuCar.Domain.Telemetry/TelemetryPublisherDisk.cs b/NucuCar.Domain.Telemetry/TelemetryPublisherDisk.cs index c2e93f7..380d401 100644 --- a/NucuCar.Domain.Telemetry/TelemetryPublisherDisk.cs +++ b/NucuCar.Domain.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.Domain.Telemetry/TelemetryPublisherFactory.cs b/NucuCar.Domain.Telemetry/TelemetryPublisherFactory.cs index ccddcf9..e5bba2b 100644 --- a/NucuCar.Domain.Telemetry/TelemetryPublisherFactory.cs +++ b/NucuCar.Domain.Telemetry/TelemetryPublisherFactory.cs @@ -1,7 +1,7 @@ using System; using Microsoft.Extensions.Logging; -using NucuCar.Common.Utilities; using NucuCar.Domain.Telemetry; +using NucuCar.Domain.Utilities; namespace NucuCar.Telemetry { diff --git a/NucuCar.Domain.Telemetry/TelemetryPublisherFirestore.cs b/NucuCar.Domain.Telemetry/TelemetryPublisherFirestore.cs index a981325..25ebc00 100644 --- a/NucuCar.Domain.Telemetry/TelemetryPublisherFirestore.cs +++ b/NucuCar.Domain.Telemetry/TelemetryPublisherFirestore.cs @@ -4,9 +4,9 @@ using System.Net; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; -using NucuCar.Common; -using NucuCar.Common.Utilities; +using NucuCar.Domain; using NucuCar.Domain.Telemetry; +using NucuCar.Domain.Utilities; namespace NucuCar.Telemetry { diff --git a/NucuCar.Common/HttpClient.cs b/NucuCar.Domain/HttpClient.cs similarity index 99% rename from NucuCar.Common/HttpClient.cs rename to NucuCar.Domain/HttpClient.cs index 1520c12..94797d4 100644 --- a/NucuCar.Common/HttpClient.cs +++ b/NucuCar.Domain/HttpClient.cs @@ -4,11 +4,11 @@ using System.Text; using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Microsoft.Extensions.Logging; using sNetHttp = System.Net.Http; using sNetHttpHeaders = System.Net.Http.Headers; -using Microsoft.Extensions.Logging; -namespace NucuCar.Common +namespace NucuCar.Domain { /// /// A simple HttpClient wrapper designed to make it easier to work with web requests with media type application/json. diff --git a/NucuCar.Common/Utilities/ConnectionStringParser.cs b/NucuCar.Domain/Utilities/ConnectionStringParser.cs similarity index 97% rename from NucuCar.Common/Utilities/ConnectionStringParser.cs rename to NucuCar.Domain/Utilities/ConnectionStringParser.cs index 040286e..30d5362 100644 --- a/NucuCar.Common/Utilities/ConnectionStringParser.cs +++ b/NucuCar.Domain/Utilities/ConnectionStringParser.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace NucuCar.Common.Utilities +namespace NucuCar.Domain.Utilities { /// /// ConnectionStringParser is an utility service to parse and validate connection strings. diff --git a/NucuCar.Common/Utilities/Guard.cs b/NucuCar.Domain/Utilities/Guard.cs similarity index 97% rename from NucuCar.Common/Utilities/Guard.cs rename to NucuCar.Domain/Utilities/Guard.cs index b84ded9..7f7b9c7 100644 --- a/NucuCar.Common/Utilities/Guard.cs +++ b/NucuCar.Domain/Utilities/Guard.cs @@ -1,6 +1,6 @@ using System; -namespace NucuCar.Common.Utilities +namespace NucuCar.Domain.Utilities { /// /// Helper class used for checking arguments and raise exception if the checks don't pass. diff --git a/NucuCar.Sensors/Properties/launchSettings.json b/NucuCar.Sensors/Properties/launchSettings.json index b190091..c4ca52b 100644 --- a/NucuCar.Sensors/Properties/launchSettings.json +++ b/NucuCar.Sensors/Properties/launchSettings.json @@ -1,6 +1,6 @@ { "profiles": { - "NucuCar.Sensors": { + "NucuCar.Sensors.Development": { "commandName": "Project", "environmentVariables": { "DOTNET_ENVIRONMENT": "Development" diff --git a/NucuCar.UnitTests/NucuCar.Common.Tests/ConnectionStringParserTest.cs b/NucuCar.UnitTests/NucuCar.Common.Tests/ConnectionStringParserTest.cs index c614e4f..b4dde39 100644 --- a/NucuCar.UnitTests/NucuCar.Common.Tests/ConnectionStringParserTest.cs +++ b/NucuCar.UnitTests/NucuCar.Common.Tests/ConnectionStringParserTest.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using NucuCar.Common.Utilities; +using NucuCar.Domain.Utilities; using Xunit; namespace NucuCar.UnitTests.NucuCar.Common.Tests diff --git a/NucuCar.UnitTests/NucuCar.Common.Tests/MockHttpClient.cs b/NucuCar.UnitTests/NucuCar.Common.Tests/MockHttpClient.cs index b738c8b..131a193 100644 --- a/NucuCar.UnitTests/NucuCar.Common.Tests/MockHttpClient.cs +++ b/NucuCar.UnitTests/NucuCar.Common.Tests/MockHttpClient.cs @@ -1,11 +1,11 @@ using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; -using HttpClient = NucuCar.Common.HttpClient; +using HttpClient = NucuCar.Domain.HttpClient; namespace NucuCar.UnitTests.NucuCar.Common.Tests { - public class MockHttpClient : HttpClient + public class MockHttpClient : Domain.HttpClient { public List SendAsyncArgCalls; public List SendAsyncResponses; diff --git a/NucuCar.UnitTests/NucuCar.Telemetry.Tests/TelemetryPublisherFirestoreTest.cs b/NucuCar.UnitTests/NucuCar.Telemetry.Tests/TelemetryPublisherFirestoreTest.cs index 7e82f7d..0dce70c 100644 --- a/NucuCar.UnitTests/NucuCar.Telemetry.Tests/TelemetryPublisherFirestoreTest.cs +++ b/NucuCar.UnitTests/NucuCar.Telemetry.Tests/TelemetryPublisherFirestoreTest.cs @@ -9,7 +9,7 @@ using NucuCar.Domain.Telemetry; using NucuCar.Telemetry; using NucuCar.UnitTests.NucuCar.Common.Tests; using Xunit; -using HttpClient = NucuCar.Common.HttpClient; +using HttpClient = NucuCar.Domain.HttpClient; namespace NucuCar.UnitTests.NucuCar.Telemetry.Tests { diff --git a/NucuCar.sln b/NucuCar.sln index 591f4ca..dc1abb2 100644 --- a/NucuCar.sln +++ b/NucuCar.sln @@ -10,8 +10,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NucuCar.UnitTests", "NucuCa EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NucuCar.Domain.Telemetry", "NucuCar.Domain.Telemetry\NucuCar.Domain.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 @@ -38,9 +36,5 @@ 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 diff --git a/NucuCar.sln.DotSettings b/NucuCar.sln.DotSettings new file mode 100644 index 0000000..b16eed8 --- /dev/null +++ b/NucuCar.sln.DotSettings @@ -0,0 +1,2 @@ + + True \ No newline at end of file