Ejemplo n.º 1
0
        public void GetFromMailboxAddressReturnsValue()
        {
            var testOptions = Options.Create <NoticeEmailOptions> (new NoticeEmailOptions
            {
                EmailSenderAddress = "*****@*****.**",
                EmailSenderName    = "someone"
            });

            var expected = new MailboxAddress(testOptions.Value.EmailSenderName, testOptions.Value.EmailSenderAddress);

            var cut    = new NoticeEmail(testOptions, null, null, fileSystem);
            var actual = cut.GetFromMailboxAddress();

            Assert.Equal(expected, actual);
        }
Ejemplo n.º 2
0
        public void GetFromMailboxAddressThrowsExceptionNoEmailSenderOptions()
        {
            var testOptions = Options.Create <NoticeEmailOptions> (new NoticeEmailOptions());

            var  expected = typeof(EmailServiceException);
            Type actual   = null;

            try
            {
                var cut = new NoticeEmail(testOptions, null, null, fileSystem);
                cut.GetFromMailboxAddress();
            }
            catch (Exception ex)
            {
                actual = ex.GetType();
            }
            Assert.Equal(expected, actual);
        }