main
1using developwithpassion.bdd.contexts;
2using developwithpassion.bdd.harnesses.mbunit;
3using developwithpassion.bdd.mocking.rhino;
4using gorilla.migrations;
5using Rhino.Mocks;
6
7namespace tests.core
8{
9 public class ConsoleSpecs
10 {
11 public abstract class concern : observations_for_a_sut_with_a_contract<Console, ConsoleApplication>
12 {
13 context c = () =>
14 {
15 command_registry = controller.the_dependency<CommandRegistry>();
16 };
17
18 static protected CommandRegistry command_registry;
19 }
20
21 public class when_processing_a_new_request : concern
22 {
23 context c = () =>
24 {
25 console_arguments = new[] {""};
26 correct_command = controller.an<ParameterizedCommand<ConsoleArguments>>();
27 command_registry.Stub(x => x.command_for(console_arguments)).Return(correct_command);
28 };
29
30 because b = () =>
31 {
32 controller.sut.run_against(console_arguments);
33 };
34
35 it should_run_the_command_that_can_handle_the_request = () =>
36 {
37 correct_command.received(x => x.run_against(console_arguments));
38 };
39
40 static string[] console_arguments;
41 static ParameterizedCommand<ConsoleArguments> correct_command;
42 }
43 }
44}