public void Returns_Null(string user, string host)
            {
                //Arrange
                var mailbox = new Mailbox(user, host);

                //Act
                var result = mailbox.AsAddress();

                //Assert
                Assert.That(result, Is.Null);
            }
            public void Returns_Address_As_String()
            {
                //Arrange
                var expectedAddress = string.Join('@', User, Host);
                var mailbox         = new Mailbox(User, Host);

                //Act
                var result = mailbox.AsAddress();

                //Assert
                Assert.That(result, Is.EqualTo(expectedAddress));
            }
            public void Returns_Address_As_String_After_Property_Values_Change()
            {
                //Arrange
                var expectedAddress = string.Join('@', User, Host);
                var mailbox         = new Mailbox();

                //Act
                mailbox.User = User;
                mailbox.Host = Host;
                var result = mailbox.AsAddress();

                //Assert
                Assert.That(result, Is.EqualTo(expectedAddress));
            }
Exemple #4
0
 public static MailboxAddress ToMailboxAddress(this Mailbox mailbox)
 {
     return(new MailboxAddress(mailbox.DisplayName, mailbox.AsAddress()));
 }