예제 #1
0
        /// <summary>
        /// Constructor for creating the representation from a message type uri.
        /// </summary>
        /// <param name="messageTypeUri">Message type uri.</param>
        public MessageType(string messageTypeUri)
        {
            var(uri, messageFamilyName, messageVersion, messageName) = MessageUtils.DecodeMessageTypeUri(messageTypeUri);

            BaseUri           = uri;
            MessageFamilyName = messageFamilyName;
            MessageVersion    = messageVersion;
            MessageName       = messageName;
            MessageTypeUri    = messageTypeUri;
        }
예제 #2
0
        public void CanDecodeValidMessageTypeUri()
        {
            var validMessageTypeUri = "did:sov:123456789abcdefghi1234;spec/examplefamily/1.0/exampletype";

            var(uri, messageFamilyName, messageVersion, messageName) = MessageUtils.DecodeMessageTypeUri(validMessageTypeUri);

            Assert.True(uri == "did:sov:123456789abcdefghi1234;spec");
            Assert.True(messageFamilyName == "examplefamily");
            Assert.True(messageVersion == "1.0");
            Assert.True(messageName == "exampletype");
        }
예제 #3
0
        public void DecodeMessageTypeUriThrowsInvalidParameterException()
        {
            var ex = Assert.Throws <AriesFrameworkException>(() => MessageUtils.DecodeMessageTypeUri("did:sov:123456789abcdefghi1234;spec"));

            Assert.True(ex.ErrorCode == ErrorCode.InvalidParameterFormat);
        }
예제 #4
0
 public void DecodeMessageTypeUriThrowsArgumentNullException()
 {
     Assert.Throws <ArgumentNullException>(() => MessageUtils.DecodeMessageTypeUri(null));
     Assert.Throws <ArgumentNullException>(() => MessageUtils.DecodeMessageTypeUri(""));
 }