コード例 #1
0
        public void SendAsync_ToEmptyEmailId_Throws()
        {
            IIdentityMessageService sendGridMessageService = new SendgridEmailService();
            var identityMessage = new IdentityMessage();

            identityMessage.Subject     = "Integration test for sending email.";
            identityMessage.Body        = "Just testing. Delete this email.";
            identityMessage.Destination = string.Empty;

            Assert.ThrowsAsync <ApplicationException>(() => sendGridMessageService.SendAsync(identityMessage));
        }
コード例 #2
0
        public void SendAsync_ToValidEmailId_DoesNotThrow()
        {
            IIdentityMessageService sendGridMessageService = new SendgridEmailService();
            var identityMessage = new IdentityMessage();

            identityMessage.Subject     = "Integration test for sending email.";
            identityMessage.Body        = "Just testing. Delete this email.";
            identityMessage.Destination = validEmailIds.First();

            Assert.DoesNotThrowAsync(() => sendGridMessageService.SendAsync(identityMessage));
        }