public void EncodeMessageToUrlThrowsArgumentNullException() { Assert.Throws <ArgumentNullException>(() => MessageUtils.EncodeMessageToUrlFormat((string)null, new ConnectionInvitationMessage())); Assert.Throws <ArgumentNullException>(() => MessageUtils.EncodeMessageToUrlFormat((Uri)null, new ConnectionInvitationMessage())); Assert.Throws <ArgumentNullException>(() => MessageUtils.EncodeMessageToUrlFormat("", new ConnectionInvitationMessage())); Assert.Throws <ArgumentNullException>(() => MessageUtils.EncodeMessageToUrlFormat(new Uri("http://example.com"), (ConnectionInvitationMessage)null)); }
public void CanEncodeMessageToUrl() { var message = new ConnectionInvitationMessage(); var exampleUrl = "http://example.com"; var encodedMessage = MessageUtils.EncodeMessageToUrlFormat(exampleUrl, message); Uri.IsWellFormedUriString(encodedMessage, UriKind.Absolute); }