/// <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; }
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"); }
public void DecodeMessageTypeUriThrowsInvalidParameterException() { var ex = Assert.Throws <AriesFrameworkException>(() => MessageUtils.DecodeMessageTypeUri("did:sov:123456789abcdefghi1234;spec")); Assert.True(ex.ErrorCode == ErrorCode.InvalidParameterFormat); }
public void DecodeMessageTypeUriThrowsArgumentNullException() { Assert.Throws <ArgumentNullException>(() => MessageUtils.DecodeMessageTypeUri(null)); Assert.Throws <ArgumentNullException>(() => MessageUtils.DecodeMessageTypeUri("")); }