Skip to content

Commit da5ed80

Browse files
go-counting: compare to sets
1 parent 1081dd0 commit da5ed80

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

exercises/practice/go-counting/.meta/Generator.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class {{ testClass }}
2626
var expectedOwner = {{ test.expected.owner | string.downcase | enum "Owner" }};
2727
var expectedCoordinates = new HashSet<(int, int)>{{ if test.expected.territory.empty? }}(){{ else }}{ {{ for territory in test.expected.territory }}({{ territory | array.join ", " }}){{ if !for.last }}, {{ end }}{{ end }} }{{ end }};
2828
Assert.Equal(expectedOwner, territoryOwner);
29-
Assert.Equal(expectedCoordinates, territoryCoordinates);
29+
Assert.Equal(expectedCoordinates, territoryCoordinates.ToHashSet());
3030
{{- else if test.property == "territories" }}
3131
var actual = sut.Territories();
3232
var expected = new Dictionary<Owner, HashSet<(int, int)>>

exercises/practice/go-counting/GoCountingTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public void Black_corner_territory_on_5x5_board()
1919
var expectedOwner = Owner.Black;
2020
var expectedCoordinates = new HashSet<(int, int)> { (0, 0), (0, 1), (1, 0) };
2121
Assert.Equal(expectedOwner, territoryOwner);
22-
Assert.Equal(expectedCoordinates, territoryCoordinates);
22+
Assert.Equal(expectedCoordinates, territoryCoordinates.ToHashSet());
2323
}
2424

2525
[Fact(Skip = "Remove this Skip property to run this test")]
@@ -37,7 +37,7 @@ public void White_center_territory_on_5x5_board()
3737
var expectedOwner = Owner.White;
3838
var expectedCoordinates = new HashSet<(int, int)> { (2, 3) };
3939
Assert.Equal(expectedOwner, territoryOwner);
40-
Assert.Equal(expectedCoordinates, territoryCoordinates);
40+
Assert.Equal(expectedCoordinates, territoryCoordinates.ToHashSet());
4141
}
4242

4343
[Fact(Skip = "Remove this Skip property to run this test")]
@@ -55,7 +55,7 @@ public void Open_corner_territory_on_5x5_board()
5555
var expectedOwner = Owner.None;
5656
var expectedCoordinates = new HashSet<(int, int)> { (0, 3), (0, 4), (1, 4) };
5757
Assert.Equal(expectedOwner, territoryOwner);
58-
Assert.Equal(expectedCoordinates, territoryCoordinates);
58+
Assert.Equal(expectedCoordinates, territoryCoordinates.ToHashSet());
5959
}
6060

6161
[Fact(Skip = "Remove this Skip property to run this test")]
@@ -73,7 +73,7 @@ public void A_stone_and_not_a_territory_on_5x5_board()
7373
var expectedOwner = Owner.None;
7474
var expectedCoordinates = new HashSet<(int, int)>();
7575
Assert.Equal(expectedOwner, territoryOwner);
76-
Assert.Equal(expectedCoordinates, territoryCoordinates);
76+
Assert.Equal(expectedCoordinates, territoryCoordinates.ToHashSet());
7777
}
7878

7979
[Fact(Skip = "Remove this Skip property to run this test")]

0 commit comments

Comments
 (0)