Creado apartir del commit b888de6c92056de294456f581a56e25e734d4ab7 de develop

This commit is contained in:
jrojas
2026-06-26 09:52:35 +02:00
commit 319fd3dfb0
746 changed files with 106610 additions and 0 deletions
@@ -0,0 +1,62 @@
using adas_core.Domain.Models.AppSettings;
using adas_core.Infrastructure.Services;
using EasyNetQ;
using EasyNetQ.SystemMessages;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Moq;
namespace adas_core.Test.Services;
[TestFixture]
public class PublisherServiceTest
{
//private static readonly DateTime now = DateTime.Now;
//private static readonly ObjectId patientId = ObjectId.GenerateNewId();
[SetUp]
public void Setup()
{
//advancedBusMock = new Mock<IAdvancedBus>();
_optionsRabbitMqSettings = Options.Create(_rabbitMqSettings);
_logger = new Mock<ILogger<PublisherService>>();
_publisherService = new PublisherService(
_optionsRabbitMqSettings,
_logger.Object);
}
private PublisherService _publisherService = null!;
//private Mock<IAdvancedBus> advancedBusMock;
private readonly RabbitMqSettings _rabbitMqSettings = new()
{
ObservationsQueue = "Observations"
};
private IOptions<RabbitMqSettings> _optionsRabbitMqSettings = null!;
private Mock<ILogger<PublisherService>> _logger = null!;
[Test]
public void SendMessage_Return_true()
{
var newMessage = new Message<string>();
var result = _publisherService.SendMessage(newMessage, _rabbitMqSettings.ObservationsQueue);
Assert.That(result, Is.Not.Null);
}
[Test]
public void SendMessage_Error_Return_true()
{
var newMessage = new Message<Error>();
var result = _publisherService.SendMessageError(newMessage, _rabbitMqSettings.ObservationsQueue);
Assert.That(result, Is.Not.Null);
}
}