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 _mockEventAlertService; public AccountAlertCheckServiceTest() { _mockEventAlertService = new Mock(); _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())).ReturnsAsync(testAlert); var manualAlert = await _accountAlertCheckService.ManualAlert(testAlert); Assert.NotNull(manualAlert); _mockEventAlertService.VerifyAll(); } } }