main
 1using developwithpassion.bdd;
 2using developwithpassion.bdd.contexts;
 3using developwithpassion.bdd.mbunit.standard.observations;
 4using mars.rover.presentation;
 5using mars.rover.presentation.infrastructure;
 6using mars.rover.service.application;
 7
 8namespace specifications.presentation
 9{
10    public class CaptureUserInstructionsPresenterSpecs
11    {
12    }
13
14    public class concerns_for_presenter : observations_for_a_sut_without_a_contract<CaptureUserInstructionsPresenter>
15    {
16        context c = () =>
17                        {
18                            view = the_dependency<CaptureUserInstructionsView>();
19                            pump = the_dependency<EventProcessor>();
20                        };
21
22        static protected CaptureUserInstructionsView view;
23        static protected EventProcessor pump;
24    }
25
26    public class when_initializing_the_user_interface : concerns_for_presenter
27    {
28        it should_wait_for_instructions_from_the_user = () => view.was_told_to(x => x.attach_to(sut));
29
30        because b = () => sut.run();
31    }
32
33    public class when_the_user_specifies_the_boundary_of_the_plateau : concerns_for_presenter
34    {
35        it should_create_mars_with_the_boundary_coordinates = () => pump.process<CreateMarsCommand, string>(input);
36
37        context c = () => { input = "5 5"; };
38
39        because b = () => sut.provide_upper_right_coordinates(input);
40
41        static string input;
42    }
43
44    public class when_the_user_specifies_the_deployment_coordinates : concerns_for_presenter
45    {
46        it should_deploy_a_rover_to_those_coordinates = () => pump.process<DeployRoverCommand, string>(input);
47
48        context c = () => { input = "1 2 N"; };
49
50        because b = () => sut.deploy_rover_to(input);
51
52        static string input;
53    }
54
55    public class when_the_user_specifies_the_navigation_instructions : concerns_for_presenter
56    {
57        it should_navigate_the_rover_using_those_instructions = () => pump.process<NavigateRoverCommand, string>(input);
58
59        context c = () => { input = "lmlmlmlmm"; };
60
61        because b = () => sut.navigate_rover_using(input);
62
63        static string input;
64    }
65}