|
| 1 | +using System; |
1 | 2 | using Xunit; |
2 | 3 |
|
3 | 4 | public class YachtTests |
4 | 5 | { |
5 | 6 | [Fact] |
6 | 7 | public void Yacht() |
7 | 8 | { |
8 | | - Assert.Equal(50, YachtGame.Score(new[] { 5, 5, 5, 5, 5 }, YachtCategory.Yacht)); |
| 9 | + Assert.Equal(50, YachtGame.Score([5, 5, 5, 5, 5], YachtCategory.Yacht)); |
9 | 10 | } |
10 | 11 |
|
11 | 12 | [Fact(Skip = "Remove this Skip property to run this test")] |
12 | 13 | public void Not_yacht() |
13 | 14 | { |
14 | | - Assert.Equal(0, YachtGame.Score(new[] { 1, 3, 3, 2, 5 }, YachtCategory.Yacht)); |
| 15 | + Assert.Equal(0, YachtGame.Score([1, 3, 3, 2, 5], YachtCategory.Yacht)); |
15 | 16 | } |
16 | 17 |
|
17 | 18 | [Fact(Skip = "Remove this Skip property to run this test")] |
18 | 19 | public void Ones() |
19 | 20 | { |
20 | | - Assert.Equal(3, YachtGame.Score(new[] { 1, 1, 1, 3, 5 }, YachtCategory.Ones)); |
| 21 | + Assert.Equal(3, YachtGame.Score([1, 1, 1, 3, 5], YachtCategory.Ones)); |
21 | 22 | } |
22 | 23 |
|
23 | 24 | [Fact(Skip = "Remove this Skip property to run this test")] |
24 | 25 | public void Ones_out_of_order() |
25 | 26 | { |
26 | | - Assert.Equal(3, YachtGame.Score(new[] { 3, 1, 1, 5, 1 }, YachtCategory.Ones)); |
| 27 | + Assert.Equal(3, YachtGame.Score([3, 1, 1, 5, 1], YachtCategory.Ones)); |
27 | 28 | } |
28 | 29 |
|
29 | 30 | [Fact(Skip = "Remove this Skip property to run this test")] |
30 | 31 | public void No_ones() |
31 | 32 | { |
32 | | - Assert.Equal(0, YachtGame.Score(new[] { 4, 3, 6, 5, 5 }, YachtCategory.Ones)); |
| 33 | + Assert.Equal(0, YachtGame.Score([4, 3, 6, 5, 5], YachtCategory.Ones)); |
33 | 34 | } |
34 | 35 |
|
35 | 36 | [Fact(Skip = "Remove this Skip property to run this test")] |
36 | 37 | public void Twos() |
37 | 38 | { |
38 | | - Assert.Equal(2, YachtGame.Score(new[] { 2, 3, 4, 5, 6 }, YachtCategory.Twos)); |
| 39 | + Assert.Equal(2, YachtGame.Score([2, 3, 4, 5, 6], YachtCategory.Twos)); |
39 | 40 | } |
40 | 41 |
|
41 | 42 | [Fact(Skip = "Remove this Skip property to run this test")] |
42 | 43 | public void Fours() |
43 | 44 | { |
44 | | - Assert.Equal(8, YachtGame.Score(new[] { 1, 4, 1, 4, 1 }, YachtCategory.Fours)); |
| 45 | + Assert.Equal(8, YachtGame.Score([1, 4, 1, 4, 1], YachtCategory.Fours)); |
45 | 46 | } |
46 | 47 |
|
47 | 48 | [Fact(Skip = "Remove this Skip property to run this test")] |
48 | 49 | public void Yacht_counted_as_threes() |
49 | 50 | { |
50 | | - Assert.Equal(15, YachtGame.Score(new[] { 3, 3, 3, 3, 3 }, YachtCategory.Threes)); |
| 51 | + Assert.Equal(15, YachtGame.Score([3, 3, 3, 3, 3], YachtCategory.Threes)); |
51 | 52 | } |
52 | 53 |
|
53 | 54 | [Fact(Skip = "Remove this Skip property to run this test")] |
54 | 55 | public void Yacht_of_3s_counted_as_fives() |
55 | 56 | { |
56 | | - Assert.Equal(0, YachtGame.Score(new[] { 3, 3, 3, 3, 3 }, YachtCategory.Fives)); |
| 57 | + Assert.Equal(0, YachtGame.Score([3, 3, 3, 3, 3], YachtCategory.Fives)); |
57 | 58 | } |
58 | 59 |
|
59 | 60 | [Fact(Skip = "Remove this Skip property to run this test")] |
60 | 61 | public void Fives() |
61 | 62 | { |
62 | | - Assert.Equal(10, YachtGame.Score(new[] { 1, 5, 3, 5, 3 }, YachtCategory.Fives)); |
| 63 | + Assert.Equal(10, YachtGame.Score([1, 5, 3, 5, 3], YachtCategory.Fives)); |
63 | 64 | } |
64 | 65 |
|
65 | 66 | [Fact(Skip = "Remove this Skip property to run this test")] |
66 | 67 | public void Sixes() |
67 | 68 | { |
68 | | - Assert.Equal(6, YachtGame.Score(new[] { 2, 3, 4, 5, 6 }, YachtCategory.Sixes)); |
| 69 | + Assert.Equal(6, YachtGame.Score([2, 3, 4, 5, 6], YachtCategory.Sixes)); |
69 | 70 | } |
70 | 71 |
|
71 | 72 | [Fact(Skip = "Remove this Skip property to run this test")] |
72 | 73 | public void Full_house_two_small_three_big() |
73 | 74 | { |
74 | | - Assert.Equal(16, YachtGame.Score(new[] { 2, 2, 4, 4, 4 }, YachtCategory.FullHouse)); |
| 75 | + Assert.Equal(16, YachtGame.Score([2, 2, 4, 4, 4], YachtCategory.FullHouse)); |
75 | 76 | } |
76 | 77 |
|
77 | 78 | [Fact(Skip = "Remove this Skip property to run this test")] |
78 | 79 | public void Full_house_three_small_two_big() |
79 | 80 | { |
80 | | - Assert.Equal(19, YachtGame.Score(new[] { 5, 3, 3, 5, 3 }, YachtCategory.FullHouse)); |
| 81 | + Assert.Equal(19, YachtGame.Score([5, 3, 3, 5, 3], YachtCategory.FullHouse)); |
81 | 82 | } |
82 | 83 |
|
83 | 84 | [Fact(Skip = "Remove this Skip property to run this test")] |
84 | 85 | public void Two_pair_is_not_a_full_house() |
85 | 86 | { |
86 | | - Assert.Equal(0, YachtGame.Score(new[] { 2, 2, 4, 4, 5 }, YachtCategory.FullHouse)); |
| 87 | + Assert.Equal(0, YachtGame.Score([2, 2, 4, 4, 5], YachtCategory.FullHouse)); |
87 | 88 | } |
88 | 89 |
|
89 | 90 | [Fact(Skip = "Remove this Skip property to run this test")] |
90 | 91 | public void Four_of_a_kind_is_not_a_full_house() |
91 | 92 | { |
92 | | - Assert.Equal(0, YachtGame.Score(new[] { 1, 4, 4, 4, 4 }, YachtCategory.FullHouse)); |
| 93 | + Assert.Equal(0, YachtGame.Score([1, 4, 4, 4, 4], YachtCategory.FullHouse)); |
93 | 94 | } |
94 | 95 |
|
95 | 96 | [Fact(Skip = "Remove this Skip property to run this test")] |
96 | 97 | public void Yacht_is_not_a_full_house() |
97 | 98 | { |
98 | | - Assert.Equal(0, YachtGame.Score(new[] { 2, 2, 2, 2, 2 }, YachtCategory.FullHouse)); |
| 99 | + Assert.Equal(0, YachtGame.Score([2, 2, 2, 2, 2], YachtCategory.FullHouse)); |
99 | 100 | } |
100 | 101 |
|
101 | 102 | [Fact(Skip = "Remove this Skip property to run this test")] |
102 | 103 | public void Four_of_a_kind() |
103 | 104 | { |
104 | | - Assert.Equal(24, YachtGame.Score(new[] { 6, 6, 4, 6, 6 }, YachtCategory.FourOfAKind)); |
| 105 | + Assert.Equal(24, YachtGame.Score([6, 6, 4, 6, 6], YachtCategory.FourOfAKind)); |
105 | 106 | } |
106 | 107 |
|
107 | 108 | [Fact(Skip = "Remove this Skip property to run this test")] |
108 | 109 | public void Yacht_can_be_scored_as_four_of_a_kind() |
109 | 110 | { |
110 | | - Assert.Equal(12, YachtGame.Score(new[] { 3, 3, 3, 3, 3 }, YachtCategory.FourOfAKind)); |
| 111 | + Assert.Equal(12, YachtGame.Score([3, 3, 3, 3, 3], YachtCategory.FourOfAKind)); |
111 | 112 | } |
112 | 113 |
|
113 | 114 | [Fact(Skip = "Remove this Skip property to run this test")] |
114 | 115 | public void Full_house_is_not_four_of_a_kind() |
115 | 116 | { |
116 | | - Assert.Equal(0, YachtGame.Score(new[] { 3, 3, 3, 5, 5 }, YachtCategory.FourOfAKind)); |
| 117 | + Assert.Equal(0, YachtGame.Score([3, 3, 3, 5, 5], YachtCategory.FourOfAKind)); |
117 | 118 | } |
118 | 119 |
|
119 | 120 | [Fact(Skip = "Remove this Skip property to run this test")] |
120 | 121 | public void Little_straight() |
121 | 122 | { |
122 | | - Assert.Equal(30, YachtGame.Score(new[] { 3, 5, 4, 1, 2 }, YachtCategory.LittleStraight)); |
| 123 | + Assert.Equal(30, YachtGame.Score([3, 5, 4, 1, 2], YachtCategory.LittleStraight)); |
123 | 124 | } |
124 | 125 |
|
125 | 126 | [Fact(Skip = "Remove this Skip property to run this test")] |
126 | 127 | public void Little_straight_as_big_straight() |
127 | 128 | { |
128 | | - Assert.Equal(0, YachtGame.Score(new[] { 1, 2, 3, 4, 5 }, YachtCategory.BigStraight)); |
| 129 | + Assert.Equal(0, YachtGame.Score([1, 2, 3, 4, 5], YachtCategory.BigStraight)); |
129 | 130 | } |
130 | 131 |
|
131 | 132 | [Fact(Skip = "Remove this Skip property to run this test")] |
132 | 133 | public void Four_in_order_but_not_a_little_straight() |
133 | 134 | { |
134 | | - Assert.Equal(0, YachtGame.Score(new[] { 1, 1, 2, 3, 4 }, YachtCategory.LittleStraight)); |
| 135 | + Assert.Equal(0, YachtGame.Score([1, 1, 2, 3, 4], YachtCategory.LittleStraight)); |
135 | 136 | } |
136 | 137 |
|
137 | 138 | [Fact(Skip = "Remove this Skip property to run this test")] |
138 | 139 | public void No_pairs_but_not_a_little_straight() |
139 | 140 | { |
140 | | - Assert.Equal(0, YachtGame.Score(new[] { 1, 2, 3, 4, 6 }, YachtCategory.LittleStraight)); |
| 141 | + Assert.Equal(0, YachtGame.Score([1, 2, 3, 4, 6], YachtCategory.LittleStraight)); |
141 | 142 | } |
142 | 143 |
|
143 | 144 | [Fact(Skip = "Remove this Skip property to run this test")] |
144 | 145 | public void Minimum_is_1_maximum_is_5_but_not_a_little_straight() |
145 | 146 | { |
146 | | - Assert.Equal(0, YachtGame.Score(new[] { 1, 1, 3, 4, 5 }, YachtCategory.LittleStraight)); |
| 147 | + Assert.Equal(0, YachtGame.Score([1, 1, 3, 4, 5], YachtCategory.LittleStraight)); |
147 | 148 | } |
148 | 149 |
|
149 | 150 | [Fact(Skip = "Remove this Skip property to run this test")] |
150 | 151 | public void Big_straight() |
151 | 152 | { |
152 | | - Assert.Equal(30, YachtGame.Score(new[] { 4, 6, 2, 5, 3 }, YachtCategory.BigStraight)); |
| 153 | + Assert.Equal(30, YachtGame.Score([4, 6, 2, 5, 3], YachtCategory.BigStraight)); |
153 | 154 | } |
154 | 155 |
|
155 | 156 | [Fact(Skip = "Remove this Skip property to run this test")] |
156 | 157 | public void Big_straight_as_little_straight() |
157 | 158 | { |
158 | | - Assert.Equal(0, YachtGame.Score(new[] { 6, 5, 4, 3, 2 }, YachtCategory.LittleStraight)); |
| 159 | + Assert.Equal(0, YachtGame.Score([6, 5, 4, 3, 2], YachtCategory.LittleStraight)); |
159 | 160 | } |
160 | 161 |
|
161 | 162 | [Fact(Skip = "Remove this Skip property to run this test")] |
162 | 163 | public void No_pairs_but_not_a_big_straight() |
163 | 164 | { |
164 | | - Assert.Equal(0, YachtGame.Score(new[] { 6, 5, 4, 3, 1 }, YachtCategory.BigStraight)); |
| 165 | + Assert.Equal(0, YachtGame.Score([6, 5, 4, 3, 1], YachtCategory.BigStraight)); |
165 | 166 | } |
166 | 167 |
|
167 | 168 | [Fact(Skip = "Remove this Skip property to run this test")] |
168 | 169 | public void Choice() |
169 | 170 | { |
170 | | - Assert.Equal(23, YachtGame.Score(new[] { 3, 3, 5, 6, 6 }, YachtCategory.Choice)); |
| 171 | + Assert.Equal(23, YachtGame.Score([3, 3, 5, 6, 6], YachtCategory.Choice)); |
171 | 172 | } |
172 | 173 |
|
173 | 174 | [Fact(Skip = "Remove this Skip property to run this test")] |
174 | 175 | public void Yacht_as_choice() |
175 | 176 | { |
176 | | - Assert.Equal(10, YachtGame.Score(new[] { 2, 2, 2, 2, 2 }, YachtCategory.Choice)); |
| 177 | + Assert.Equal(10, YachtGame.Score([2, 2, 2, 2, 2], YachtCategory.Choice)); |
177 | 178 | } |
178 | 179 | } |
0 commit comments