main
 1using gorilla.commons.utility;
 2
 3namespace tests.unit.commons.utility
 4{
 5    [Concern(typeof (MappingExtensions))]
 6    public class when_transforming_type_A_to_type_B_then_C : concerns
 7    {
 8        it should_return_the_correct_result = () => result.should_be_equal_to(1);
 9
10        context c = () =>
11        {
12            first_mapper = an<Mapper<object, string>>();
13            second_mapper = an<Mapper<string, int>>();
14            a = 1;
15
16            first_mapper.is_told_to(x => x.map_from(a)).it_will_return("1");
17            second_mapper.is_told_to(x => x.map_from("1")).it_will_return(1);
18        };
19
20        because b = () =>
21        {
22            result = first_mapper.then(second_mapper).map_from(a);
23        };
24
25
26        static int result;
27        static Mapper<object, string> first_mapper;
28        static Mapper<string, int> second_mapper;
29        static object a;
30    }
31}