Created Windows Service
This commit is contained in:
@ -112,6 +112,9 @@ internal class SmtpServiceTests {
|
||||
|
||||
Assert.True(await _smtpService.SendEmail(ADDRESS_LIST, ADDRESS_LIST, "subject", "body"));
|
||||
|
||||
_mockSmtpClient.Verify(s => s.Send(It.IsAny<MailMessage>()));
|
||||
string? env = Environment.GetEnvironmentVariable("FabApprovalEnvironmentName");
|
||||
|
||||
if (env is not null && !env.ToLower().Equals("development"))
|
||||
_mockSmtpClient.Verify(s => s.Send(It.IsAny<MailMessage>()));
|
||||
}
|
||||
}
|
||||
|
29
FabApprovalWorkerServiceTests/TrainingServiceTests.cs
Normal file
29
FabApprovalWorkerServiceTests/TrainingServiceTests.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using FabApprovalWorkerService.Services;
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
using Moq;
|
||||
|
||||
namespace FabApprovalWorkerServiceTests;
|
||||
public class TrainingServiceTests {
|
||||
private Mock<ILogger<TrainingService>> _mockLogger;
|
||||
private Mock<IDalService> _mockDalService;
|
||||
|
||||
private TrainingService _trainingService;
|
||||
|
||||
[SetUp]
|
||||
public void Setup() {
|
||||
_mockLogger = new Mock<ILogger<TrainingService>>();
|
||||
_mockDalService = new Mock<IDalService>();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TrainingServiceWithNullLoggerShouldThrowException() {
|
||||
Assert.Throws<ArgumentNullException>(() => new TrainingService(null, _mockDalService.Object));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TrainingServiceWithNullDalServiceShouldThrowException() {
|
||||
Assert.Throws<ArgumentNullException>(() => new TrainingService(_mockLogger.Object, null));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user