main
1using System;
2using developwithpassion.bdd.contexts;
3using developwithpassion.bdd.mbunit;
4using developwithpassion.bdd.mbunit.standard.observations;
5using mars.rover.domain;
6using mars.rover.presentation.model;
7
8namespace specifications.presentation.model
9{
10 public class HeadingFactorySpecs
11 {
12 }
13
14 public class when_checking_if_a_heading_factory_can_produce_a_heading_for_a_type_that_it_cannot :
15 observations_for_a_sut_without_a_contract<HeadingFactory>
16 {
17 it should_return_false = () => result.should_be_equal_to(false);
18
19 context c = () => { provide_a_basic_sut_constructor_argument("S"); };
20 because b = () => { result = sut.is_satisfied_by("N"); };
21
22 static bool result;
23 }
24
25 public class when_checking_if_a_heading_factory_can_produce_a_heading_for_a_type_that_it_can :
26 observations_for_a_sut_without_a_contract<HeadingFactory>
27 {
28 it should_return_true = () => result.should_be_equal_to(true);
29
30 context c = () => { provide_a_basic_sut_constructor_argument("S"); };
31 because b = () => { result = sut.is_satisfied_by("s"); };
32
33 static bool result;
34 }
35
36 public class when_telling_the_factory_to_produce_a_heading :
37 observations_for_a_sut_without_a_contract<HeadingFactory>
38 {
39 it should_return_the_correct_type = () => { result.should_be_equal_to(heading); };
40
41 context c = () =>
42 {
43 heading = an<Heading>();
44 plateau = an<Plateau>();
45 Func<Plateau, Heading> factory = x => heading;
46 provide_a_basic_sut_constructor_argument("E");
47 provide_a_basic_sut_constructor_argument(factory);
48 };
49
50 because b = () => { result = sut.create(plateau); };
51
52 static Heading result;
53 static Heading heading;
54 static Plateau plateau;
55 }
56}