Refactor NucuCar.UnitTests

This commit is contained in:
Denis-Cosmin Nutiu 2020-08-01 18:32:45 +03:00
parent 3805bd0f15
commit 25d85dc526
5 changed files with 10 additions and 8 deletions

View file

@ -3,7 +3,7 @@ using NucuCar.Telemetry;
using NucuCar.Telemetry.Publishers; using NucuCar.Telemetry.Publishers;
using Xunit; using Xunit;
namespace NucuCar.UnitTests.NucuCar.Telemetry.Tests namespace NucuCar.UnitTests.NucuCar.Domain.Telemetry.Tests
{ {
public class TelemetryPublisherFactoryTest public class TelemetryPublisherFactoryTest
{ {

View file

@ -7,12 +7,11 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using NucuCar.Domain.Http; using NucuCar.Domain.Http;
using NucuCar.Telemetry; using NucuCar.Telemetry;
using NucuCar.Telemetry.Abstractions;
using NucuCar.Telemetry.Publishers; using NucuCar.Telemetry.Publishers;
using Xunit; using Xunit;
using HttpClient = NucuCar.Domain.Http.HttpClient; using HttpClient = NucuCar.Domain.Http.HttpClient;
namespace NucuCar.UnitTests.NucuCar.Telemetry.Tests namespace NucuCar.UnitTests.NucuCar.Domain.Telemetry.Tests
{ {
/// <summary> /// <summary>
/// Class used to test the TelemetryPublisherFirestore by mocking the GetTelemetry method and HttpClient field. /// Class used to test the TelemetryPublisherFirestore by mocking the GetTelemetry method and HttpClient field.

View file

@ -1,13 +1,12 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Moq; using Moq;
using NucuCar.Sensors;
using NucuCar.Sensors.Abstractions; using NucuCar.Sensors.Abstractions;
using NucuCar.Sensors.Modules.Environment; using NucuCar.Sensors.Modules.Environment;
using NucuCarSensorsProto; using NucuCarSensorsProto;
using Xunit; using Xunit;
namespace NucuCar.UnitTests.NucuCar.Sensors.Tests.EnvironmentSensor.Tests namespace NucuCar.UnitTests.NucuCar.Sensors.Tests.EnvironmentSensor
{ {
public class Bme680GrpcServiceTest public class Bme680GrpcServiceTest
{ {

View file

@ -2,7 +2,7 @@ using System.Threading.Tasks;
using NucuCar.Sensors.Modules.Environment; using NucuCar.Sensors.Modules.Environment;
using NucuCarSensorsProto; using NucuCarSensorsProto;
namespace NucuCar.UnitTests.NucuCar.Sensors.Tests.EnvironmentSensor.Tests namespace NucuCar.UnitTests.NucuCar.Sensors.Tests.EnvironmentSensor
{ {
public class TestBme680Sensor : Bme680Sensor public class TestBme680Sensor : Bme680Sensor
{ {

View file

@ -5,12 +5,16 @@ using Microsoft.Extensions.Options;
using Moq; using Moq;
using NucuCar.Sensors.Abstractions; using NucuCar.Sensors.Abstractions;
using NucuCar.Sensors.Modules.Environment; using NucuCar.Sensors.Modules.Environment;
using NucuCar.UnitTests.NucuCar.Sensors.Tests.EnvironmentSensor.Tests; using NucuCar.UnitTests.NucuCar.Sensors.Tests.EnvironmentSensor;
using NucuCarSensorsProto; using NucuCarSensorsProto;
using Xunit; using Xunit;
namespace NucuCar.UnitTests.NucuCar.Sensors.Tests.EnvironmentSensor namespace NucuCar.UnitTests.NucuCar.Sensors.Tests
{ {
/// <summary>
/// Tests the functionality of the SensorWorker; Since the class is quite generic the test uses the
/// Bme680Worker as an example.
/// </summary>
public class Bme680WorkerTest public class Bme680WorkerTest
{ {
private readonly Mock<ILogger<Bme680Worker>> _mockLogger; private readonly Mock<ILogger<Bme680Worker>> _mockLogger;