|
1 | | -using System; |
2 | 1 | using Xunit; |
3 | 2 |
|
4 | 3 | public class DominoesTests |
5 | 4 | { |
6 | 5 | [Fact] |
7 | 6 | public void Empty_input_empty_output() |
8 | 7 | { |
9 | | - var dominoes = Array.Empty<(int, int)>(); |
10 | | - Assert.True(Dominoes.CanChain(dominoes)); |
| 8 | + Assert.True(Dominoes.CanChain([])); |
11 | 9 | } |
12 | 10 |
|
13 | 11 | [Fact(Skip = "Remove this Skip property to run this test")] |
14 | 12 | public void Singleton_input_singleton_output() |
15 | 13 | { |
16 | | - var dominoes = new[] { (1, 1) }; |
17 | | - Assert.True(Dominoes.CanChain(dominoes)); |
| 14 | + Assert.True(Dominoes.CanChain([(1, 1)])); |
18 | 15 | } |
19 | 16 |
|
20 | 17 | [Fact(Skip = "Remove this Skip property to run this test")] |
21 | | - public void Singleton_that_cant_be_chained() |
| 18 | + public void Singleton_that_can_t_be_chained() |
22 | 19 | { |
23 | | - var dominoes = new[] { (1, 2) }; |
24 | | - Assert.False(Dominoes.CanChain(dominoes)); |
| 20 | + Assert.False(Dominoes.CanChain([(1, 2)])); |
25 | 21 | } |
26 | 22 |
|
27 | 23 | [Fact(Skip = "Remove this Skip property to run this test")] |
28 | 24 | public void Three_elements() |
29 | 25 | { |
30 | | - var dominoes = new[] { (1, 2), (3, 1), (2, 3) }; |
31 | | - Assert.True(Dominoes.CanChain(dominoes)); |
| 26 | + Assert.True(Dominoes.CanChain([(1, 2), (3, 1), (2, 3)])); |
32 | 27 | } |
33 | 28 |
|
34 | 29 | [Fact(Skip = "Remove this Skip property to run this test")] |
35 | 30 | public void Can_reverse_dominoes() |
36 | 31 | { |
37 | | - var dominoes = new[] { (1, 2), (1, 3), (2, 3) }; |
38 | | - Assert.True(Dominoes.CanChain(dominoes)); |
| 32 | + Assert.True(Dominoes.CanChain([(1, 2), (1, 3), (2, 3)])); |
39 | 33 | } |
40 | 34 |
|
41 | 35 | [Fact(Skip = "Remove this Skip property to run this test")] |
42 | | - public void Cant_be_chained() |
| 36 | + public void Can_t_be_chained() |
43 | 37 | { |
44 | | - var dominoes = new[] { (1, 2), (4, 1), (2, 3) }; |
45 | | - Assert.False(Dominoes.CanChain(dominoes)); |
| 38 | + Assert.False(Dominoes.CanChain([(1, 2), (4, 1), (2, 3)])); |
46 | 39 | } |
47 | 40 |
|
48 | 41 | [Fact(Skip = "Remove this Skip property to run this test")] |
49 | 42 | public void Disconnected_simple() |
50 | 43 | { |
51 | | - var dominoes = new[] { (1, 1), (2, 2) }; |
52 | | - Assert.False(Dominoes.CanChain(dominoes)); |
| 44 | + Assert.False(Dominoes.CanChain([(1, 1), (2, 2)])); |
53 | 45 | } |
54 | 46 |
|
55 | 47 | [Fact(Skip = "Remove this Skip property to run this test")] |
56 | 48 | public void Disconnected_double_loop() |
57 | 49 | { |
58 | | - var dominoes = new[] { (1, 2), (2, 1), (3, 4), (4, 3) }; |
59 | | - Assert.False(Dominoes.CanChain(dominoes)); |
| 50 | + Assert.False(Dominoes.CanChain([(1, 2), (2, 1), (3, 4), (4, 3)])); |
60 | 51 | } |
61 | 52 |
|
62 | 53 | [Fact(Skip = "Remove this Skip property to run this test")] |
63 | 54 | public void Disconnected_single_isolated() |
64 | 55 | { |
65 | | - var dominoes = new[] { (1, 2), (2, 3), (3, 1), (4, 4) }; |
66 | | - Assert.False(Dominoes.CanChain(dominoes)); |
| 56 | + Assert.False(Dominoes.CanChain([(1, 2), (2, 3), (3, 1), (4, 4)])); |
67 | 57 | } |
68 | 58 |
|
69 | 59 | [Fact(Skip = "Remove this Skip property to run this test")] |
70 | 60 | public void Need_backtrack() |
71 | 61 | { |
72 | | - var dominoes = new[] { (1, 2), (2, 3), (3, 1), (2, 4), (2, 4) }; |
73 | | - Assert.True(Dominoes.CanChain(dominoes)); |
| 62 | + Assert.True(Dominoes.CanChain([(1, 2), (2, 3), (3, 1), (2, 4), (2, 4)])); |
74 | 63 | } |
75 | 64 |
|
76 | 65 | [Fact(Skip = "Remove this Skip property to run this test")] |
77 | 66 | public void Separate_loops() |
78 | 67 | { |
79 | | - var dominoes = new[] { (1, 2), (2, 3), (3, 1), (1, 1), (2, 2), (3, 3) }; |
80 | | - Assert.True(Dominoes.CanChain(dominoes)); |
| 68 | + Assert.True(Dominoes.CanChain([(1, 2), (2, 3), (3, 1), (1, 1), (2, 2), (3, 3)])); |
81 | 69 | } |
82 | 70 |
|
83 | 71 | [Fact(Skip = "Remove this Skip property to run this test")] |
84 | 72 | public void Nine_elements() |
85 | 73 | { |
86 | | - var dominoes = new[] { (1, 2), (5, 3), (3, 1), (1, 2), (2, 4), (1, 6), (2, 3), (3, 4), (5, 6) }; |
87 | | - Assert.True(Dominoes.CanChain(dominoes)); |
| 74 | + Assert.True(Dominoes.CanChain([(1, 2), (5, 3), (3, 1), (1, 2), (2, 4), (1, 6), (2, 3), (3, 4), (5, 6)])); |
88 | 75 | } |
89 | 76 |
|
90 | 77 | [Fact(Skip = "Remove this Skip property to run this test")] |
91 | 78 | public void Separate_three_domino_loops() |
92 | 79 | { |
93 | | - var dominoes = new[] { (1, 2), (2, 3), (3, 1), (4, 5), (5, 6), (6, 4) }; |
94 | | - Assert.False(Dominoes.CanChain(dominoes)); |
| 80 | + Assert.False(Dominoes.CanChain([(1, 2), (2, 3), (3, 1), (4, 5), (5, 6), (6, 4)])); |
95 | 81 | } |
96 | 82 | } |
0 commit comments