/// <summary>
        /// Initializes a new instance of the <see cref="CommandInvokedMessage"/> class.
        /// </summary>
        /// <param name="origin">The endpoint that send the original message.</param>
        /// <param name="id">The ID of the current message.</param>
        /// <param name="methodInvocation">The information about the <see cref="ICommandSet"/> method that was invoked.</param>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="origin"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="id"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="methodInvocation"/> is <see langword="null" />.
        /// </exception>
        public CommandInvokedMessage(EndpointId origin, MessageId id, CommandInvokedData methodInvocation)
            : base(origin, id)
        {
            {
                Lokad.Enforce.Argument(() => methodInvocation);
            }

            Invocation = methodInvocation;
        }
        public void Create()
        {
            var id             = new EndpointId("sendingEndpoint");
            var commandId      = CommandId.Create(typeof(int).GetMethod("CompareTo", new[] { typeof(object) }));
            var invocationData = new CommandInvokedData(
                commandId,
                new[]
            {
                new CommandParameterValueMap(
                    new CommandParameterDefinition(typeof(int), "other", CommandParameterOrigin.FromCommand),
                    1.0),
            });
            var msg = new CommandInvokedMessage(id, invocationData);

            Assert.AreSame(id, msg.Sender);
            Assert.AreSame(invocationData, msg.Invocation);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="CommandInvokedMessage"/> class.
 /// </summary>
 /// <param name="origin">The endpoint that send the original message.</param>
 /// <param name="methodInvocation">The information about the <see cref="ICommandSet"/> method that was invoked.</param>
 /// <exception cref="ArgumentNullException">
 ///     Thrown if <paramref name="origin"/> is <see langword="null" />.
 /// </exception>
 /// <exception cref="ArgumentNullException">
 ///     Thrown if <paramref name="methodInvocation"/> is <see langword="null" />.
 /// </exception>
 public CommandInvokedMessage(EndpointId origin, CommandInvokedData methodInvocation)
     : this(origin, new MessageId(), methodInvocation)
 {
 }