From 25d85dc5260b5b6ee5f1b4fd61a5395ad66ccc58 Mon Sep 17 00:00:00 2001 From: Denis Nutiu Date: Sat, 1 Aug 2020 18:32:45 +0300 Subject: [PATCH] Refactor NucuCar.UnitTests --- .../TelemetryPublisherFactoryTest.cs | 2 +- .../TelemetryPublisherFirestoreTest.cs | 3 +-- .../EnvironmentSensor/Bme680GrpcServiceTest.cs | 3 +-- .../EnvironmentSensor/TestBme680Sensor.cs | 2 +- .../Bme680WorkerTests.cs => SensorWorker.cs} | 8 ++++++-- 5 files changed, 10 insertions(+), 8 deletions(-) rename NucuCar.UnitTests/{NucuCar.Telemetry.Tests => NucuCar.Domain.Telemetry.Tests}/TelemetryPublisherFactoryTest.cs (96%) rename NucuCar.UnitTests/{NucuCar.Telemetry.Tests => NucuCar.Domain.Telemetry.Tests}/TelemetryPublisherFirestoreTest.cs (98%) rename NucuCar.UnitTests/NucuCar.Sensors.Tests/{EnvironmentSensor/Bme680WorkerTests.cs => SensorWorker.cs} (89%) diff --git a/NucuCar.UnitTests/NucuCar.Telemetry.Tests/TelemetryPublisherFactoryTest.cs b/NucuCar.UnitTests/NucuCar.Domain.Telemetry.Tests/TelemetryPublisherFactoryTest.cs similarity index 96% rename from NucuCar.UnitTests/NucuCar.Telemetry.Tests/TelemetryPublisherFactoryTest.cs rename to NucuCar.UnitTests/NucuCar.Domain.Telemetry.Tests/TelemetryPublisherFactoryTest.cs index dda899c..2e9b562 100644 --- a/NucuCar.UnitTests/NucuCar.Telemetry.Tests/TelemetryPublisherFactoryTest.cs +++ b/NucuCar.UnitTests/NucuCar.Domain.Telemetry.Tests/TelemetryPublisherFactoryTest.cs @@ -3,7 +3,7 @@ using NucuCar.Telemetry; using NucuCar.Telemetry.Publishers; using Xunit; -namespace NucuCar.UnitTests.NucuCar.Telemetry.Tests +namespace NucuCar.UnitTests.NucuCar.Domain.Telemetry.Tests { public class TelemetryPublisherFactoryTest { diff --git a/NucuCar.UnitTests/NucuCar.Telemetry.Tests/TelemetryPublisherFirestoreTest.cs b/NucuCar.UnitTests/NucuCar.Domain.Telemetry.Tests/TelemetryPublisherFirestoreTest.cs similarity index 98% rename from NucuCar.UnitTests/NucuCar.Telemetry.Tests/TelemetryPublisherFirestoreTest.cs rename to NucuCar.UnitTests/NucuCar.Domain.Telemetry.Tests/TelemetryPublisherFirestoreTest.cs index ef97e84..6d47c3e 100644 --- a/NucuCar.UnitTests/NucuCar.Telemetry.Tests/TelemetryPublisherFirestoreTest.cs +++ b/NucuCar.UnitTests/NucuCar.Domain.Telemetry.Tests/TelemetryPublisherFirestoreTest.cs @@ -7,12 +7,11 @@ using System.Threading; using System.Threading.Tasks; using NucuCar.Domain.Http; using NucuCar.Telemetry; -using NucuCar.Telemetry.Abstractions; using NucuCar.Telemetry.Publishers; using Xunit; using HttpClient = NucuCar.Domain.Http.HttpClient; -namespace NucuCar.UnitTests.NucuCar.Telemetry.Tests +namespace NucuCar.UnitTests.NucuCar.Domain.Telemetry.Tests { /// /// Class used to test the TelemetryPublisherFirestore by mocking the GetTelemetry method and HttpClient field. diff --git a/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor/Bme680GrpcServiceTest.cs b/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor/Bme680GrpcServiceTest.cs index b836c11..145b3cf 100644 --- a/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor/Bme680GrpcServiceTest.cs +++ b/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor/Bme680GrpcServiceTest.cs @@ -1,13 +1,12 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Moq; -using NucuCar.Sensors; using NucuCar.Sensors.Abstractions; using NucuCar.Sensors.Modules.Environment; using NucuCarSensorsProto; using Xunit; -namespace NucuCar.UnitTests.NucuCar.Sensors.Tests.EnvironmentSensor.Tests +namespace NucuCar.UnitTests.NucuCar.Sensors.Tests.EnvironmentSensor { public class Bme680GrpcServiceTest { diff --git a/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor/TestBme680Sensor.cs b/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor/TestBme680Sensor.cs index 120d3bb..bfe065f 100644 --- a/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor/TestBme680Sensor.cs +++ b/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor/TestBme680Sensor.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using NucuCar.Sensors.Modules.Environment; using NucuCarSensorsProto; -namespace NucuCar.UnitTests.NucuCar.Sensors.Tests.EnvironmentSensor.Tests +namespace NucuCar.UnitTests.NucuCar.Sensors.Tests.EnvironmentSensor { public class TestBme680Sensor : Bme680Sensor { diff --git a/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor/Bme680WorkerTests.cs b/NucuCar.UnitTests/NucuCar.Sensors.Tests/SensorWorker.cs similarity index 89% rename from NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor/Bme680WorkerTests.cs rename to NucuCar.UnitTests/NucuCar.Sensors.Tests/SensorWorker.cs index b5255be..a3afa66 100644 --- a/NucuCar.UnitTests/NucuCar.Sensors.Tests/EnvironmentSensor/Bme680WorkerTests.cs +++ b/NucuCar.UnitTests/NucuCar.Sensors.Tests/SensorWorker.cs @@ -5,12 +5,16 @@ using Microsoft.Extensions.Options; using Moq; using NucuCar.Sensors.Abstractions; using NucuCar.Sensors.Modules.Environment; -using NucuCar.UnitTests.NucuCar.Sensors.Tests.EnvironmentSensor.Tests; +using NucuCar.UnitTests.NucuCar.Sensors.Tests.EnvironmentSensor; using NucuCarSensorsProto; using Xunit; -namespace NucuCar.UnitTests.NucuCar.Sensors.Tests.EnvironmentSensor +namespace NucuCar.UnitTests.NucuCar.Sensors.Tests { + /// + /// Tests the functionality of the SensorWorker; Since the class is quite generic the test uses the + /// Bme680Worker as an example. + /// public class Bme680WorkerTest { private readonly Mock> _mockLogger;