main
 1using jive;
 2using Machine.Specifications;
 3
 4namespace specs.unit.utility
 5{
 6  [Subject(typeof (MappingExtensions))]
 7  public class when_transforming_type_A_to_type_B_then_C
 8  {
 9    It should_return_the_correct_result = () => result.should_be_equal_to(1);
10
11    Establish c = () =>
12    {
13      first_mapper = Create.an<Mapper<object, string>>();
14      second_mapper = Create.an<Mapper<string, int>>();
15      a = 1;
16
17      first_mapper.Setup(x => x.map_from(a)).Returns("1");
18      second_mapper.Setup(x => x.map_from("1")).Returns(1);
19    };
20
21    Because b = () =>
22    {
23      result = first_mapper.Object.then(second_mapper.Object).map_from(a);
24    };
25
26
27    static int result;
28    static Moq.Mock<Mapper<object, string>> first_mapper;
29    static Moq.Mock<Mapper<string, int>> second_mapper;
30    static object a;
31  }
32}