main
1using System;
2using developwithpassion.bdd;
3using developwithpassion.bdd.contexts;
4using developwithpassion.bdd.mbunit.standard.observations;
5using mars.rover.common;
6using mars.rover.presentation.infrastructure;
7using Rhino.Mocks;
8
9namespace specifications.presentation.infrastructure
10{
11 public class SynchronousCommandPumpSpecs
12 {
13 }
14
15 public class when_putting_a_command_on_the_command_processor :
16 observations_for_a_sut_with_a_contract<EventProcessor, SynchronousCommandPump>
17 {
18 it should_place_the_correct_command_on_the_processor =
19 () => processor.received(x => x.add(Arg<Command>.Is.Anything));
20
21 context c = () =>
22 {
23 processor = the_dependency<CommandProcessor>();
24 registry = the_dependency<Registry<ParameterizedCommand<string>>>();
25 factory = the_dependency<CommandFactory>();
26 correct = an<Correct>();
27 incorrect = an<InCorrect>();
28 registry.is_told_to(x => x.all()).it_will_return(correct, incorrect);
29 };
30
31 because b = () => sut.process<Correct, string>("blah");
32
33 static CommandProcessor processor;
34 static Registry<ParameterizedCommand<string>> registry;
35 static CommandFactory factory;
36 static Correct correct;
37 static InCorrect incorrect;
38 }
39
40 public class InCorrect : ParameterizedCommand<string>
41 {
42 public void run_against(string item)
43 {
44 throw new NotImplementedException();
45 }
46 }
47
48 public class Correct : ParameterizedCommand<string>
49 {
50 public void run_against(string item)
51 {
52 throw new NotImplementedException();
53 }
54 }
55}