public void TryParseAddress_Failure(string value) { EmailAddress address = null; bool result = SendGridHelpers.TryParseAddress(value, out address); Assert.False(result); Assert.Null(address); }
public void TryParseAddress_Success() { EmailAddress address = null; SendGridHelpers.TryParseAddress("*****@*****.**", out address); Assert.Equal("*****@*****.**", address.Email); Assert.Null(address.Name); address = null; SendGridHelpers.TryParseAddress("Test Account <*****@*****.**>", out address); Assert.Equal("*****@*****.**", address.Email); Assert.Equal("Test Account", address.Name); }
public void TryParseAddress_Success() { MailAddress address = null; SendGridHelpers.TryParseAddress("*****@*****.**", out address); Assert.Equal("*****@*****.**", address.Address); Assert.Equal(string.Empty, address.DisplayName); address = null; SendGridHelpers.TryParseAddress("Test Account <*****@*****.**>", out address); Assert.Equal("*****@*****.**", address.Address); Assert.Equal("Test Account", address.DisplayName); }