Exemplo n.º 1
0
        public void SendToAdministrator_ShouldSend_DefaultingFromAndToAddress()
        {
            //Arrange
            var subject     = "Test";
            var message     = "Message";
            var mimeMessage = new MimeMessage();

            _mimeMessageFactoryMock
            .Setup(f => f.CreateFromMessage(_options.AdminEmail, _options.AdminEmail, null, subject, message, ""))
            .Returns(mimeMessage).Verifiable();

            //Act
            _service.SendMessageToAdministrator(subject, message);

            //Verify
            _mimeMessageFactoryMock.Verify();
            _mimeKitServiceMock.Verify(k => k.SendEmail(mimeMessage));
        }