/*============================================================================*/
        /* Constructor                                                                */
        /*============================================================================*/

        public DirectCommandMapper(ICommandExecutor executor, ICommandMappingList mappings, Type commandClass)
        {
            _executor = executor;
            _mappings = mappings;
            _mapping  = new CommandMapping(commandClass);
            _mapping.SetFireOnce(true);
            _mappings.AddMapping(_mapping);
        }
예제 #2
0
        public void oneShotMapping_is_removed()
        {
            subject = new CommandExecutor(injector, unMapper.Object.Unmap);
            ICommandMapping mapping = addMapping <ClassReportingCallbackCommand>();

            mapping.SetFireOnce(true);

            subject.ExecuteCommands(mappings);

            unMapper.Verify(unMapperObject => unMapperObject.Unmap(It.Is <ICommandMapping> (arg => arg == mapping)), Times.Once);
        }
 /**
  * @inheritDoc
  */
 public ICommandConfigurator Once(bool value = true)
 {
     _mapping.SetFireOnce(value);
     return(this);
 }