main
 1using developwithpassion.bdd.contexts;
 2using Gorilla.Commons.Testing;
 3
 4namespace MoMoney.Domain.Core
 5{
 6    public class RankingSpecs
 7    {
 8    }
 9
10    public abstract class behaves_like_a_list_of_calgary_flames_point_leaders : concerns_for<IRanking<string>, Ranking<string>>
11    {
12        after_the_sut_has_been_created c = () =>
13                        {
14                            sut.add("Jarome Iginla");
15                            sut.add("Mike Cammalleri");
16                            sut.add("Daymond Langkow");
17                            sut.add("Todd Bertuzzi");
18                            sut.add("Rene Bourque");
19                            sut.add("Dion Phaneuf");
20                            sut.add("Craig Conroy");
21                            sut.add("Curtis Glencross");
22                            sut.add("David Moss");
23                            sut.add("Adrian Aucoin");
24                        };
25    }
26
27    public class when_someone_ranked_higher_is_compared_with_someone_ranked_lower :
28        behaves_like_a_list_of_calgary_flames_point_leaders
29    {
30        it the_higher_ranked_player_should_be_revealed = () => result.should_be_greater_than(0);
31
32        because b = () => { result = sut.Compare("Jarome Iginla", "Mike Cammalleri"); };
33
34        static int result;
35    }
36
37    public class when_someone_ranked_lower_is_compared_with_someone_ranked_higher :
38        behaves_like_a_list_of_calgary_flames_point_leaders
39    {
40        it the_lower_ranked_player_should_be_revealed = () => result.should_be_less_than(0);
41
42        because b = () => { result = sut.Compare("Mike Cammalleri", "Jarome Iginla"); };
43
44        static int result;
45    }
46
47    public class when_a_ranked_player_is_compared_with_them_selves :
48        behaves_like_a_list_of_calgary_flames_point_leaders
49    {
50        it should_indicate_that_they_are_ranked_the_same = () => result.should_be_equal_to(0);
51
52        because b = () => { result = sut.Compare("David Moss", "David Moss"); };
53
54        static int result;
55    }
56
57    public class when_an_unranked_player_is_compared_to_a_ranked_player :
58        behaves_like_a_list_of_calgary_flames_point_leaders
59    {
60        it should_ranked_the_ranked_player_higher = () => result.should_be_less_than(0);
61
62        because b = () => { result = sut.Compare("Brett Sutter", "Jarome Iginla"); };
63
64        static int result;
65    }
66
67    public class when_an_ranked_player_is_compared_to_a_unranked_player :
68        behaves_like_a_list_of_calgary_flames_point_leaders
69    {
70        it should_ranked_the_ranked_player_higher = () => result.should_be_greater_than(0);
71
72        because b = () => { result = sut.Compare("Jarome Iginla", "Brett Sutter"); };
73
74        static int result;
75    }
76}