rama creada apartir de master en j
This commit is contained in:
@@ -15,25 +15,30 @@ namespace adas_core.Test.Services;
|
||||
[TestFixture]
|
||||
public class LightBeaconServiceTest
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes the test fixture by creating mock instances of the service's dependencies
|
||||
/// and instantiating the <see cref="LightBeaconService"/> under test with those mocks.
|
||||
/// This setup runs before each test to ensure a clean, isolated test environment.
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
_optionsApiSettings = Options.Create(_apiSettings);
|
||||
_pocService = new Mock<IPointOfCareService>();
|
||||
_clientMessageService = new Mock<IClientMessageService>();
|
||||
_subscribersService = new Mock<ISubscribersService>();
|
||||
_logger = new Mock<ILogger<LightBeaconService>>();
|
||||
_lightBeaconRepository = new Mock<ILightBeaconRepository>();
|
||||
|
||||
_lightBeaconService = new LightBeaconService(
|
||||
_optionsApiSettings,
|
||||
_logger.Object,
|
||||
_clientMessageService.Object,
|
||||
_subscribersService.Object,
|
||||
_pocService.Object,
|
||||
_lightBeaconRepository.Object
|
||||
);
|
||||
}
|
||||
public void Setup()
|
||||
{
|
||||
_optionsApiSettings = Options.Create(_apiSettings);
|
||||
_pocService = new Mock<IPointOfCareService>();
|
||||
_clientMessageService = new Mock<IClientMessageService>();
|
||||
_subscribersService = new Mock<ISubscribersService>();
|
||||
_logger = new Mock<ILogger<LightBeaconService>>();
|
||||
_lightBeaconRepository = new Mock<ILightBeaconRepository>();
|
||||
|
||||
_lightBeaconService = new LightBeaconService(
|
||||
_optionsApiSettings,
|
||||
_logger.Object,
|
||||
_clientMessageService.Object,
|
||||
_subscribersService.Object,
|
||||
_pocService.Object,
|
||||
_lightBeaconRepository.Object
|
||||
);
|
||||
}
|
||||
|
||||
private LightBeaconService _lightBeaconService = null!;
|
||||
|
||||
@@ -51,20 +56,23 @@ public class LightBeaconServiceTest
|
||||
private Mock<ISubscribersService> _subscribersService = null!;
|
||||
private Mock<ILightBeaconRepository> _lightBeaconRepository = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Integration test that verifies the light beacon service returns <see cref="LightBeaconColor.Off"/> for a given point of care when the patient has no associated beacon color.
|
||||
/// </summary>
|
||||
[Ignore("Integration test")]
|
||||
[Test]
|
||||
public async Task GetBeaconColor()
|
||||
{
|
||||
var patient = new Patient
|
||||
[Test]
|
||||
public async Task GetBeaconColor()
|
||||
{
|
||||
UnitId = ObjectId.GenerateNewId(),
|
||||
PointOfCareId = ObjectId.GenerateNewId()
|
||||
};
|
||||
|
||||
|
||||
var color = await _lightBeaconService.GetColor(patient.PointOfCareId.Value);
|
||||
|
||||
Assert.That(color, Is.EqualTo(
|
||||
LightBeaconColor.Off));
|
||||
}
|
||||
var patient = new Patient
|
||||
{
|
||||
UnitId = ObjectId.GenerateNewId(),
|
||||
PointOfCareId = ObjectId.GenerateNewId()
|
||||
};
|
||||
|
||||
|
||||
var color = await _lightBeaconService.GetColor(patient.PointOfCareId.Value);
|
||||
|
||||
Assert.That(color, Is.EqualTo(
|
||||
LightBeaconColor.Off));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user