コード例 #1
0
 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));
 }
コード例 #2
0
        public void CanEncodeMessageToUrl()
        {
            var message    = new ConnectionInvitationMessage();
            var exampleUrl = "http://example.com";

            var encodedMessage = MessageUtils.EncodeMessageToUrlFormat(exampleUrl, message);

            Uri.IsWellFormedUriString(encodedMessage, UriKind.Absolute);
        }