Exemple #1
0
 public void given_command(string noun, string verb)
 {
     _command = new MemoryCommandDescriptor()
     {
         Noun = noun, Verb = verb
     };
 }
        protected void given_command(string verb, string noun, params Action <MemoryCommandDescriptor>[] configurators)
        {
            var command = new MemoryCommandDescriptor {
                Noun = noun, Verb = verb
            };

            foreach (var c in configurators)
            {
                c(command);
            }
            Repository.Add(command);
        }
 protected void given_command(string verb, string noun, params Expression<Func<InputBuilder, InputBuilder>>[] properties)
 {
     Command = new MemoryCommandDescriptor(
             properties.Select(property => property.Compile()(
                     new InputBuilder(property.Parameters[0].Name).Setter((cmd, val) => SaveProperty(property.Parameters[0].Name, val)))
                                                   .Descriptor))
     {
             Verb = verb,
             Noun = noun,
             Create = () => new MemoryCommand
             {
                     Execute = () =>
                     {
                         CommandExecuted = true;
                         return Enumerable.Empty<ICommandOutput>();
                     }
             }
     };
 }
Exemple #4
0
 protected void given_command(string verb, string noun, params Expression <Func <InputBuilder, InputBuilder> >[] properties)
 {
     Command = new MemoryCommandDescriptor(
         properties.Select(property => property.Compile()(
                               new InputBuilder(property.Parameters[0].Name).Setter((cmd, val) => SaveProperty(property.Parameters[0].Name, val)))
                           .Descriptor))
     {
         Verb   = verb,
         Noun   = noun,
         Create = () => new MemoryCommand
         {
             Execute = () =>
             {
                 CommandExecuted = true;
                 return(Enumerable.Empty <ICommandOutput>());
             }
         }
     };
 }
 protected void given_command(string noun, string verb)
 {
     Command = new MemoryCommandDescriptor { Noun = noun, Verb = verb };
 }
 protected void given_command(string verb, string noun, params Action<MemoryCommandDescriptor>[] configurators)
 {
     var command = new MemoryCommandDescriptor { Noun = noun, Verb = verb };
     foreach(var c in configurators) c(command);
     Repository.Add(command);
 }
 protected void given_command(string noun, string verb)
 {
     Command = new MemoryCommandDescriptor {
         Noun = noun, Verb = verb
     };
 }