2025-11-04 11:54:39 -05:00
|
|
|
|
using Bit.Core.Platform.Mail.Delivery;
|
2021-02-22 15:35:16 -06:00
|
|
|
|
using Bit.Core.Settings;
|
2019-07-05 22:35:54 -05:00
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
|
using NSubstitute;
|
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Bit.Core.Test.Services;
|
2022-08-29 16:06:55 -04:00
|
|
|
|
|
2019-07-05 22:35:54 -05:00
|
|
|
|
public class MailKitSmtpMailDeliveryServiceTests
|
|
|
|
|
|
{
|
|
|
|
|
|
private readonly MailKitSmtpMailDeliveryService _sut;
|
|
|
|
|
|
|
|
|
|
|
|
private readonly GlobalSettings _globalSettings;
|
|
|
|
|
|
private readonly ILogger<MailKitSmtpMailDeliveryService> _logger;
|
|
|
|
|
|
|
|
|
|
|
|
public MailKitSmtpMailDeliveryServiceTests()
|
|
|
|
|
|
{
|
|
|
|
|
|
_globalSettings = new GlobalSettings();
|
|
|
|
|
|
_logger = Substitute.For<ILogger<MailKitSmtpMailDeliveryService>>();
|
|
|
|
|
|
|
|
|
|
|
|
_globalSettings.Mail.Smtp.Host = "unittests.example.com";
|
|
|
|
|
|
_globalSettings.Mail.ReplyToEmail = "noreply@unittests.example.com";
|
|
|
|
|
|
|
|
|
|
|
|
_sut = new MailKitSmtpMailDeliveryService(
|
|
|
|
|
|
_globalSettings,
|
2025-07-21 11:54:00 -04:00
|
|
|
|
_logger
|
2019-07-05 22:35:54 -05:00
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Remove this test when we add actual tests. It only proves that
|
|
|
|
|
|
// we've properly constructed the system under test.
|
|
|
|
|
|
[Fact]
|
|
|
|
|
|
public void ServiceExists()
|
|
|
|
|
|
{
|
|
|
|
|
|
Assert.NotNull(_sut);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|