Esempio n. 1
0
        public void When_SendEmailWithWrongToAddress_Expect_LastExceptionNotNull_Win()
        {
            server.ClearReceivedEmail();
            var os         = WinApp.CreateObjectSpace();
            var Parameters = os.CreateObject <TestEmailParameters>();

            Parameters.To               = "BadEmailAddress";
            Parameters.Body             = "Hello";
            Parameters.From             = "*****@*****.**";
            Parameters.SmtpEmailAccount = os.FindObject <SmtpEmailAccount>(new BinaryOperator(nameof(SmtpEmailAccount.Name), AccountNamePort25));

            SmtpEmailAccountController.SendEmailSilently(Parameters);

            Assert.NotNull(SmtpEmailAccountController.LastException);
        }
Esempio n. 2
0
        public void When_SendEmailWithoutSslOrAuth_Expect_EmailSent_Win()
        {
            server.ClearReceivedEmail();
            var os         = WinApp.CreateObjectSpace();
            var Parameters = os.CreateObject <TestEmailParameters>();

            Parameters.To               = "*****@*****.**";
            Parameters.Body             = "Hello";
            Parameters.From             = "*****@*****.**";
            Parameters.SmtpEmailAccount = os.FindObject <SmtpEmailAccount>(new BinaryOperator(nameof(SmtpEmailAccount.Name), AccountNamePort25));

            SmtpEmailAccountController.SendEmailSilently(Parameters);

            Assert.AreEqual(server.ReceivedEmailCount, 1);
        }