private ICommandMapping addMapping(Type commandClass = null)
        {
            if (commandClass == null)
            {
                commandClass = typeof(ClassReportingCallbackCommand);
            }
            ICommandMapping mapping = new CommandMapping(commandClass);

            mappings.Add(mapping);
            return(mapping);
        }
        public void result_is_handled()
        {
            ICommandMapping mapping = new CommandMapping(typeof(MessageReturningCommand));

            subject = new CommandExecutor(injector, null, resultReporter);
            injector.Map <String>().ToValue("message");
            subject.ExecuteCommand(mapping);
            Assert.That(reported.Count, Is.EqualTo(1));
            Assert.That(reported [0], Is.InstanceOf <Dictionary <string, object> > ());
            Dictionary <string, object> reportedDict = reported [0] as Dictionary <string, object>;

            Assert.That(reportedDict["result"], Is.EqualTo("message"));
            Assert.That(reportedDict["command"], Is.InstanceOf <MessageReturningCommand>());
            Assert.That(reportedDict["mapping"], Is.EqualTo(mapping));
        }
 public void before()
 {
     commandClass = typeof(NullCommand);
     mapping      = new CommandMapping(commandClass);
 }