diff --git a/NucuCar.Domain/Telemetry/ITelemeter.cs b/NucuCar.Domain.Telemetry/Abstractions/ITelemeter.cs similarity index 97% rename from NucuCar.Domain/Telemetry/ITelemeter.cs rename to NucuCar.Domain.Telemetry/Abstractions/ITelemeter.cs index d457b4e..a33917e 100644 --- a/NucuCar.Domain/Telemetry/ITelemeter.cs +++ b/NucuCar.Domain.Telemetry/Abstractions/ITelemeter.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace NucuCar.Domain.Telemetry +namespace NucuCar.Telemetry.Abstractions { /// /// Interface that specifies that the component implementing it is willing to provide telemetry data and can be diff --git a/NucuCar.Domain/Telemetry/TelemetryPublisher.cs b/NucuCar.Domain.Telemetry/Abstractions/TelemetryPublisher.cs similarity index 96% rename from NucuCar.Domain/Telemetry/TelemetryPublisher.cs rename to NucuCar.Domain.Telemetry/Abstractions/TelemetryPublisher.cs index 0ba7693..374fa00 100644 --- a/NucuCar.Domain/Telemetry/TelemetryPublisher.cs +++ b/NucuCar.Domain.Telemetry/Abstractions/TelemetryPublisher.cs @@ -3,8 +3,9 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; +using NucuCar.Telemetry.Publishers; -namespace NucuCar.Domain.Telemetry +namespace NucuCar.Telemetry.Abstractions { /// /// The TelemetryPublisher is an abstract class, which provides a base for implementing telemetry publishers. @@ -83,8 +84,8 @@ namespace NucuCar.Domain.Telemetry /// /// Constructor for . /// - /// TelemetryPublisher options, see: - protected TelemetryPublisher(TelemetryPublisherBuilderOptions opts) + /// TelemetryPublisher options, see: + protected TelemetryPublisher(TelemetryPublisherOptions opts) { ConnectionString = opts.ConnectionString; TelemetrySource = opts.TelemetrySource; diff --git a/NucuCar.Domain.Telemetry/TelemetryPublisherAzure.cs b/NucuCar.Domain.Telemetry/Publishers/TelemetryPublisherAzure.cs similarity index 94% rename from NucuCar.Domain.Telemetry/TelemetryPublisherAzure.cs rename to NucuCar.Domain.Telemetry/Publishers/TelemetryPublisherAzure.cs index 5c08e87..edbc9c8 100644 --- a/NucuCar.Domain.Telemetry/TelemetryPublisherAzure.cs +++ b/NucuCar.Domain.Telemetry/Publishers/TelemetryPublisherAzure.cs @@ -5,9 +5,9 @@ using System.Threading.Tasks; using Microsoft.Azure.Devices.Client; using Microsoft.Extensions.Logging; using Newtonsoft.Json; -using NucuCar.Domain.Telemetry; +using NucuCar.Telemetry.Abstractions; -namespace NucuCar.Telemetry +namespace NucuCar.Telemetry.Publishers { /// /// Constructs an instance of . It is used to publish telemetry to Microsoft @@ -20,7 +20,7 @@ namespace NucuCar.Telemetry { protected readonly DeviceClient DeviceClient; - public TelemetryPublisherAzure(TelemetryPublisherBuilderOptions opts) : base(opts) + public TelemetryPublisherAzure(TelemetryPublisherOptions opts) : base(opts) { try { diff --git a/NucuCar.Domain.Telemetry/TelemetryPublisherConsole.cs b/NucuCar.Domain.Telemetry/Publishers/TelemetryPublisherConsole.cs similarity index 79% rename from NucuCar.Domain.Telemetry/TelemetryPublisherConsole.cs rename to NucuCar.Domain.Telemetry/Publishers/TelemetryPublisherConsole.cs index f944fc2..06c9671 100644 --- a/NucuCar.Domain.Telemetry/TelemetryPublisherConsole.cs +++ b/NucuCar.Domain.Telemetry/Publishers/TelemetryPublisherConsole.cs @@ -2,14 +2,14 @@ using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Newtonsoft.Json; -using NucuCar.Domain.Telemetry; +using NucuCar.Telemetry.Abstractions; -namespace NucuCar.Telemetry +namespace NucuCar.Telemetry.Publishers { public class TelemetryPublisherConsole : TelemetryPublisher { - public TelemetryPublisherConsole(TelemetryPublisherBuilderOptions opts) : base(opts) + public TelemetryPublisherConsole(TelemetryPublisherOptions opts) : base(opts) { } diff --git a/NucuCar.Domain.Telemetry/TelemetryPublisherDisk.cs b/NucuCar.Domain.Telemetry/Publishers/TelemetryPublisherDisk.cs similarity index 94% rename from NucuCar.Domain.Telemetry/TelemetryPublisherDisk.cs rename to NucuCar.Domain.Telemetry/Publishers/TelemetryPublisherDisk.cs index 380d401..df04ab1 100644 --- a/NucuCar.Domain.Telemetry/TelemetryPublisherDisk.cs +++ b/NucuCar.Domain.Telemetry/Publishers/TelemetryPublisherDisk.cs @@ -6,10 +6,10 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Newtonsoft.Json; -using NucuCar.Domain.Telemetry; using NucuCar.Domain.Utilities; +using NucuCar.Telemetry.Abstractions; -namespace NucuCar.Telemetry +namespace NucuCar.Telemetry.Publishers { /// /// The TelemetryPublisherDisk is used to publish telemetry data to a file on the disk. @@ -30,7 +30,7 @@ namespace NucuCar.Telemetry /// /// /// - public TelemetryPublisherDisk(TelemetryPublisherBuilderOptions opts) : base(opts) + public TelemetryPublisherDisk(TelemetryPublisherOptions opts) : base(opts) { var connectionStringParams = ConnectionStringParser.Parse(opts.ConnectionString); var fileName = connectionStringParams.GetValueOrDefault("FileName", "telemetry"); diff --git a/NucuCar.Domain.Telemetry/TelemetryPublisherFirestore.cs b/NucuCar.Domain.Telemetry/Publishers/TelemetryPublisherFirestore.cs similarity index 97% rename from NucuCar.Domain.Telemetry/TelemetryPublisherFirestore.cs rename to NucuCar.Domain.Telemetry/Publishers/TelemetryPublisherFirestore.cs index f76ed12..3d52138 100644 --- a/NucuCar.Domain.Telemetry/TelemetryPublisherFirestore.cs +++ b/NucuCar.Domain.Telemetry/Publishers/TelemetryPublisherFirestore.cs @@ -4,12 +4,11 @@ using System.Net; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; -using NucuCar.Domain; using NucuCar.Domain.Http; -using NucuCar.Domain.Telemetry; using NucuCar.Domain.Utilities; +using NucuCar.Telemetry.Abstractions; -namespace NucuCar.Telemetry +namespace NucuCar.Telemetry.Publishers { /// /// This class is used to publish the telemetry data to Google's Cloud Firestore. @@ -37,7 +36,7 @@ namespace NucuCar.Telemetry private readonly string _webPassword; private readonly string _webApiKey; - public TelemetryPublisherFirestore(TelemetryPublisherBuilderOptions opts) : base(opts) + public TelemetryPublisherFirestore(TelemetryPublisherOptions opts) : base(opts) { // Parse Options var options = ConnectionStringParser.Parse(opts.ConnectionString); diff --git a/NucuCar.Domain.Telemetry/Telemetry.cs b/NucuCar.Domain.Telemetry/Telemetry.cs index f7137b3..567768e 100644 --- a/NucuCar.Domain.Telemetry/Telemetry.cs +++ b/NucuCar.Domain.Telemetry/Telemetry.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using NucuCar.Domain.Telemetry; +using NucuCar.Telemetry.Abstractions; // ReSharper disable ClassWithVirtualMembersNeverInherited.Global diff --git a/NucuCar.Domain.Telemetry/TelemetryConfig.cs b/NucuCar.Domain.Telemetry/TelemetryConfig.cs index 53d39b0..a60bc5d 100644 --- a/NucuCar.Domain.Telemetry/TelemetryConfig.cs +++ b/NucuCar.Domain.Telemetry/TelemetryConfig.cs @@ -1,6 +1,6 @@ // ReSharper disable UnusedAutoPropertyAccessor.Global -using NucuCar.Domain.Telemetry; +using NucuCar.Telemetry.Abstractions; namespace NucuCar.Telemetry { diff --git a/NucuCar.Domain.Telemetry/TelemetryPublisherFactory.cs b/NucuCar.Domain.Telemetry/TelemetryPublisherFactory.cs index 205d45b..946cc78 100644 --- a/NucuCar.Domain.Telemetry/TelemetryPublisherFactory.cs +++ b/NucuCar.Domain.Telemetry/TelemetryPublisherFactory.cs @@ -1,7 +1,8 @@ using System; using Microsoft.Extensions.Logging; -using NucuCar.Domain.Telemetry; using NucuCar.Domain.Utilities; +using NucuCar.Telemetry.Abstractions; +using NucuCar.Telemetry.Publishers; namespace NucuCar.Telemetry { @@ -24,7 +25,7 @@ namespace NucuCar.Telemetry Guard.ArgumentNotNullOrWhiteSpace(nameof(connectionString), connectionString); Guard.ArgumentNotNullOrWhiteSpace(nameof(telemetrySource), telemetrySource); Guard.ArgumentNotNull(nameof(logger), logger); - var opts = new TelemetryPublisherBuilderOptions() + var opts = new TelemetryPublisherOptions() {ConnectionString = connectionString, TelemetrySource = telemetrySource, Logger = logger}; return SpawnPublisher(type, opts); } @@ -38,12 +39,12 @@ namespace NucuCar.Telemetry public static TelemetryPublisher CreateFromConnectionString(string type, string connectionString) { Guard.ArgumentNotNullOrWhiteSpace(nameof(connectionString), connectionString); - var opts = new TelemetryPublisherBuilderOptions() + var opts = new TelemetryPublisherOptions() {ConnectionString = connectionString, TelemetrySource = "TelemetryPublisherAzure"}; return SpawnPublisher(type, opts); } - private static TelemetryPublisher SpawnPublisher(string type, TelemetryPublisherBuilderOptions opts) + private static TelemetryPublisher SpawnPublisher(string type, TelemetryPublisherOptions opts) { return type switch { diff --git a/NucuCar.Domain/Telemetry/TelemetryPublisherBuilderOptions.cs b/NucuCar.Domain.Telemetry/TelemetryPublisherOptions.cs similarity index 85% rename from NucuCar.Domain/Telemetry/TelemetryPublisherBuilderOptions.cs rename to NucuCar.Domain.Telemetry/TelemetryPublisherOptions.cs index 9411218..492a0fc 100644 --- a/NucuCar.Domain/Telemetry/TelemetryPublisherBuilderOptions.cs +++ b/NucuCar.Domain.Telemetry/TelemetryPublisherOptions.cs @@ -1,25 +1,26 @@ -using Microsoft.Extensions.Logging; - -namespace NucuCar.Domain.Telemetry -{ - /// - /// This class contains options for the . - /// - public class TelemetryPublisherBuilderOptions - { - /// - /// The ConnectionString used by the publisher to connect to the cloud service. - /// - public string ConnectionString { get; set; } - - /// - /// A string that indicates the source of the telemetry data. - /// - public string TelemetrySource { get; set; } - - /// - /// The logger instance. - /// - public ILogger Logger { get; set; } - } +using Microsoft.Extensions.Logging; +using NucuCar.Telemetry.Abstractions; + +namespace NucuCar.Telemetry +{ + /// + /// This class contains options for the . + /// + public class TelemetryPublisherOptions + { + /// + /// The ConnectionString used by the publisher to connect to the cloud service. + /// + public string ConnectionString { get; set; } + + /// + /// A string that indicates the source of the telemetry data. + /// + public string TelemetrySource { get; set; } + + /// + /// The logger instance. + /// + public ILogger Logger { get; set; } + } } \ No newline at end of file diff --git a/NucuCar.Domain.Telemetry/TelemetryPublisherType.cs b/NucuCar.Domain.Telemetry/TelemetryPublisherType.cs index b987869..8af6f2b 100644 --- a/NucuCar.Domain.Telemetry/TelemetryPublisherType.cs +++ b/NucuCar.Domain.Telemetry/TelemetryPublisherType.cs @@ -1,4 +1,4 @@ -using NucuCar.Domain.Telemetry; +using NucuCar.Telemetry.Abstractions; namespace NucuCar.Telemetry { diff --git a/NucuCar.Domain.Telemetry/TelemetryWorker.cs b/NucuCar.Domain.Telemetry/TelemetryWorker.cs index bcc53f8..081da60 100644 --- a/NucuCar.Domain.Telemetry/TelemetryWorker.cs +++ b/NucuCar.Domain.Telemetry/TelemetryWorker.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using NucuCar.Domain.Telemetry; +using NucuCar.Telemetry.Abstractions; namespace NucuCar.Telemetry { diff --git a/NucuCar.Domain/Sensors/GenericSensor.cs b/NucuCar.Sensors/Abstractions/GenericSensor.cs similarity index 93% rename from NucuCar.Domain/Sensors/GenericSensor.cs rename to NucuCar.Sensors/Abstractions/GenericSensor.cs index 64ac641..f90407b 100644 --- a/NucuCar.Domain/Sensors/GenericSensor.cs +++ b/NucuCar.Sensors/Abstractions/GenericSensor.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using Microsoft.Extensions.Logging; using NucuCarSensorsProto; -namespace NucuCar.Domain.Sensors +namespace NucuCar.Sensors.Abstractions { /// /// The GenericSensor is an abstract class, which provides a base for abstracting hardware sensors. diff --git a/NucuCar.Domain/Sensors/GenericTelemeterSensor.cs b/NucuCar.Sensors/Abstractions/GenericTelemeterSensor.cs similarity index 80% rename from NucuCar.Domain/Sensors/GenericTelemeterSensor.cs rename to NucuCar.Sensors/Abstractions/GenericTelemeterSensor.cs index ba5930b..08d1510 100644 --- a/NucuCar.Domain/Sensors/GenericTelemeterSensor.cs +++ b/NucuCar.Sensors/Abstractions/GenericTelemeterSensor.cs @@ -1,13 +1,13 @@ using System.Collections.Generic; -using NucuCar.Domain.Telemetry; +using NucuCar.Telemetry.Abstractions; -namespace NucuCar.Domain.Sensors +namespace NucuCar.Sensors.Abstractions { /// /// The GenericSensor is an abstract class, which provides a base for abstracting hardware sensors /// with telemetry support. /// See: - /// See: + /// See: /// public abstract class GenericTelemeterSensor : GenericSensor, ITelemeter { diff --git a/NucuCar.Sensors/ISensor.cs b/NucuCar.Sensors/Abstractions/ISensor.cs similarity index 69% rename from NucuCar.Sensors/ISensor.cs rename to NucuCar.Sensors/Abstractions/ISensor.cs index fa22d68..0f70a39 100644 --- a/NucuCar.Sensors/ISensor.cs +++ b/NucuCar.Sensors/Abstractions/ISensor.cs @@ -1,6 +1,4 @@ -using NucuCar.Domain.Sensors; - -namespace NucuCar.Sensors +namespace NucuCar.Sensors.Abstractions { public interface ISensor where TSensor : GenericTelemeterSensor { diff --git a/NucuCar.Sensors/Environment/Bme680GrpcService.cs b/NucuCar.Sensors/Environment/Bme680GrpcService.cs index d802a49..1b5a80c 100644 --- a/NucuCar.Sensors/Environment/Bme680GrpcService.cs +++ b/NucuCar.Sensors/Environment/Bme680GrpcService.cs @@ -3,6 +3,7 @@ using Google.Protobuf.WellKnownTypes; using Grpc.Core; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; +using NucuCar.Sensors.Abstractions; using NucuCar.Sensors.Grpc; using NucuCarSensorsProto; diff --git a/NucuCar.Sensors/Environment/Bme680Sensor.cs b/NucuCar.Sensors/Environment/Bme680Sensor.cs index b54f2b4..2bd93e7 100644 --- a/NucuCar.Sensors/Environment/Bme680Sensor.cs +++ b/NucuCar.Sensors/Environment/Bme680Sensor.cs @@ -5,7 +5,7 @@ using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Newtonsoft.Json; -using NucuCar.Domain.Sensors; +using NucuCar.Sensors.Abstractions; using NucuCar.Sensors.Environment.Bmxx80; using NucuCarSensorsProto; using Bme680 = NucuCar.Sensors.Environment.Bmxx80.Bme680; diff --git a/NucuCar.Sensors/Environment/Bme680Worker.cs b/NucuCar.Sensors/Environment/Bme680Worker.cs index 536b7ce..cbd492a 100644 --- a/NucuCar.Sensors/Environment/Bme680Worker.cs +++ b/NucuCar.Sensors/Environment/Bme680Worker.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.Logging; +using NucuCar.Sensors.Abstractions; using NucuCar.Telemetry; namespace NucuCar.Sensors.Environment diff --git a/NucuCar.Sensors/Health/CpuTempGrpcService.cs b/NucuCar.Sensors/Health/CpuTempGrpcService.cs index 21a0b32..898efa7 100644 --- a/NucuCar.Sensors/Health/CpuTempGrpcService.cs +++ b/NucuCar.Sensors/Health/CpuTempGrpcService.cs @@ -3,6 +3,7 @@ using Google.Protobuf.WellKnownTypes; using Grpc.Core; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; +using NucuCar.Sensors.Abstractions; using NucuCar.Sensors.Grpc; using NucuCarSensorsProto; diff --git a/NucuCar.Sensors/Health/CpuTempSensor.cs b/NucuCar.Sensors/Health/CpuTempSensor.cs index 2b39be2..d4e54e7 100644 --- a/NucuCar.Sensors/Health/CpuTempSensor.cs +++ b/NucuCar.Sensors/Health/CpuTempSensor.cs @@ -5,7 +5,7 @@ using Iot.Device.CpuTemperature; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Newtonsoft.Json; -using NucuCar.Domain.Sensors; +using NucuCar.Sensors.Abstractions; using NucuCarSensorsProto; namespace NucuCar.Sensors.Health diff --git a/NucuCar.Sensors/Health/CpuTempWorker.cs b/NucuCar.Sensors/Health/CpuTempWorker.cs index 471c40d..18c2257 100644 --- a/NucuCar.Sensors/Health/CpuTempWorker.cs +++ b/NucuCar.Sensors/Health/CpuTempWorker.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.Logging; +using NucuCar.Sensors.Abstractions; using NucuCar.Telemetry; namespace NucuCar.Sensors.Health diff --git a/NucuCar.Sensors/NucuCar.Sensors.csproj b/NucuCar.Sensors/NucuCar.Sensors.csproj index 9a1cfd5..f02c1dd 100644 --- a/NucuCar.Sensors/NucuCar.Sensors.csproj +++ b/NucuCar.Sensors/NucuCar.Sensors.csproj @@ -81,4 +81,8 @@ + + + + diff --git a/NucuCar.Sensors/Program.cs b/NucuCar.Sensors/Program.cs index cfd0fe0..f68923b 100644 --- a/NucuCar.Sensors/Program.cs +++ b/NucuCar.Sensors/Program.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using NucuCar.Sensors.Abstractions; using NucuCar.Sensors.Environment; using NucuCar.Sensors.Grpc; using NucuCar.Sensors.Health; diff --git a/NucuCar.Sensors/SensorWorker.cs b/NucuCar.Sensors/SensorWorker.cs index c89f0e9..0fb393e 100644 --- a/NucuCar.Sensors/SensorWorker.cs +++ b/NucuCar.Sensors/SensorWorker.cs @@ -3,8 +3,8 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; -using NucuCar.Domain.Sensors; -using NucuCar.Domain.Telemetry; +using NucuCar.Sensors.Abstractions; +using NucuCar.Telemetry.Abstractions; using NucuCarSensorsProto; namespace NucuCar.Sensors diff --git a/NucuCar.TestClient/Telemetry/AzureTelemetryPublishCmd.cs b/NucuCar.TestClient/Telemetry/AzureTelemetryPublishCmd.cs index 6f817ad..e57ae7a 100644 --- a/NucuCar.TestClient/Telemetry/AzureTelemetryPublishCmd.cs +++ b/NucuCar.TestClient/Telemetry/AzureTelemetryPublishCmd.cs @@ -6,8 +6,8 @@ using System.Threading.Tasks; using CommandLine; using Microsoft.Extensions.Logging; using Newtonsoft.Json; -using NucuCar.Domain.Telemetry; using NucuCar.Telemetry; +using NucuCar.Telemetry.Abstractions; namespace NucuCar.TestClient.Telemetry { diff --git a/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor.Tests/Bme680GrpcServiceTest.cs b/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor.Tests/Bme680GrpcServiceTest.cs index 57d23e0..a2e8210 100644 --- a/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor.Tests/Bme680GrpcServiceTest.cs +++ b/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor.Tests/Bme680GrpcServiceTest.cs @@ -2,6 +2,7 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Moq; using NucuCar.Sensors; +using NucuCar.Sensors.Abstractions; using NucuCar.Sensors.Environment; using NucuCarSensorsProto; using Xunit; diff --git a/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor.Tests/Bme680WorkerTests.cs b/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor.Tests/Bme680WorkerTests.cs index a5635ae..214a785 100644 --- a/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor.Tests/Bme680WorkerTests.cs +++ b/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor.Tests/Bme680WorkerTests.cs @@ -4,6 +4,7 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Moq; using NucuCar.Sensors; +using NucuCar.Sensors.Abstractions; using NucuCar.Sensors.Environment; using NucuCarSensorsProto; using Xunit; diff --git a/NucuCar.UnitTests/NucuCar.Telemetry.Tests/TelemetryPublisherFactoryTest.cs b/NucuCar.UnitTests/NucuCar.Telemetry.Tests/TelemetryPublisherFactoryTest.cs index 572f2b4..dda899c 100644 --- a/NucuCar.UnitTests/NucuCar.Telemetry.Tests/TelemetryPublisherFactoryTest.cs +++ b/NucuCar.UnitTests/NucuCar.Telemetry.Tests/TelemetryPublisherFactoryTest.cs @@ -1,5 +1,6 @@ using System; using NucuCar.Telemetry; +using NucuCar.Telemetry.Publishers; using Xunit; namespace NucuCar.UnitTests.NucuCar.Telemetry.Tests diff --git a/NucuCar.UnitTests/NucuCar.Telemetry.Tests/TelemetryPublisherFirestoreTest.cs b/NucuCar.UnitTests/NucuCar.Telemetry.Tests/TelemetryPublisherFirestoreTest.cs index bbc95de..ef97e84 100644 --- a/NucuCar.UnitTests/NucuCar.Telemetry.Tests/TelemetryPublisherFirestoreTest.cs +++ b/NucuCar.UnitTests/NucuCar.Telemetry.Tests/TelemetryPublisherFirestoreTest.cs @@ -6,8 +6,9 @@ using System.Net.Http.Headers; using System.Threading; using System.Threading.Tasks; using NucuCar.Domain.Http; -using NucuCar.Domain.Telemetry; using NucuCar.Telemetry; +using NucuCar.Telemetry.Abstractions; +using NucuCar.Telemetry.Publishers; using Xunit; using HttpClient = NucuCar.Domain.Http.HttpClient; @@ -20,7 +21,7 @@ namespace NucuCar.UnitTests.NucuCar.Telemetry.Tests { private Dictionary _mockData; - public MockTelemetryPublisherFirestore(TelemetryPublisherBuilderOptions opts) : base(opts) + public MockTelemetryPublisherFirestore(TelemetryPublisherOptions opts) : base(opts) { _mockData = new Dictionary(); } @@ -47,7 +48,7 @@ namespace NucuCar.UnitTests.NucuCar.Telemetry.Tests private void Test_Construct_BadProjectId() { // Setup - var opts = new TelemetryPublisherBuilderOptions() + var opts = new TelemetryPublisherOptions() { ConnectionString = "ProjectIdBAD=test;CollectionName=test" }; @@ -60,7 +61,7 @@ namespace NucuCar.UnitTests.NucuCar.Telemetry.Tests private void Test_Construct_BadCollectiontName() { // Setup - var opts = new TelemetryPublisherBuilderOptions() + var opts = new TelemetryPublisherOptions() { ConnectionString = "ProjectId=test;CollectionNameBAD=test" }; @@ -73,7 +74,7 @@ namespace NucuCar.UnitTests.NucuCar.Telemetry.Tests private async Task Test_PublishAsync_OK() { // Setup - var opts = new TelemetryPublisherBuilderOptions() + var opts = new TelemetryPublisherOptions() { ConnectionString = "ProjectId=test;CollectionName=test" }; @@ -98,7 +99,7 @@ namespace NucuCar.UnitTests.NucuCar.Telemetry.Tests private async Task Test_PublishAsync_Cancel() { // Setup - var opts = new TelemetryPublisherBuilderOptions() + var opts = new TelemetryPublisherOptions() { ConnectionString = "ProjectId=test;CollectionName=test" }; @@ -122,7 +123,7 @@ namespace NucuCar.UnitTests.NucuCar.Telemetry.Tests private async Task Test_PublishAsync_Authorization_OK() { // Setup - var opts = new TelemetryPublisherBuilderOptions() + var opts = new TelemetryPublisherOptions() { ConnectionString = "ProjectId=test;CollectionName=test;WebApiKey=TAPIKEY;WebApiEmail=t@emai.com;WebApiPassword=tpass"