Files
2026-04-20 14:47:24 -05:00

38 lines
1.2 KiB
C#

using System.Threading.Tasks;
using LCU.API.Collections.RepoApi.Services;
using LCU.API.Collections.RepoApi.Services.Producer;
using LCU.Shared.Collections.RepoApiLib.Models;
using Moq;
using Xunit;
namespace LCU.API.Collections.RepoApiTests.Services
{
public class AccountAlertCheckServiceTest
{
private readonly IAccountAlertCheckService _accountAlertCheckService;
private readonly Mock<IEventAlertService> _mockEventAlertService;
public AccountAlertCheckServiceTest()
{
_mockEventAlertService = new Mock<IEventAlertService>();
_accountAlertCheckService = new AccountAlertCheckService(_mockEventAlertService.Object);
}
[Fact]
public async Task ListAll_Ok()
{
var testAlert = new EventAlert()
{
Message = "testing",
AccountNo = "123456-789"
};
_mockEventAlertService.Setup(x => x.SaveAsync(It.IsAny<EventAlert>())).ReturnsAsync(testAlert);
var manualAlert = await _accountAlertCheckService.ManualAlert(testAlert);
Assert.NotNull(manualAlert);
_mockEventAlertService.VerifyAll();
}
}
}