どうぶつしょうぎの完全解析をするGUI
@@ -58,7 +58,7 @@ | ||
58 | 58 | '''ToString のテスト |
59 | 59 | '''</summary> |
60 | 60 | <TestMethod()> _ |
61 | - Public Sub ToStringTest() | |
61 | + Public Sub ToStringTest1() | |
62 | 62 | Dim target As Board = New Board() ' TODO: 適切な値に初期化してください |
63 | 63 | Dim expected As String = "-KI-LI-ZO" & vbCrLf & |
64 | 64 | " . -HI . " & vbCrLf & |
@@ -86,6 +86,22 @@ | ||
86 | 86 | Assert.AreEqual(expected, target.ToString) |
87 | 87 | End Sub |
88 | 88 | |
89 | + <TestMethod()> _ | |
90 | + Public Sub ToStringTest2() | |
91 | + Dim target As Board = New Board() | |
92 | + Dim move1 As New Move("+B3B2HI") | |
93 | + Dim move2 As New Move("-C1B2ZO") | |
94 | + target.DoMove(move1) | |
95 | + target.DoMove(move2) | |
96 | + Assert.AreEqual(1, target.CapturedKomaCount(Koma.GoteHI)) | |
97 | + Dim expected As String = "-KI-LI . " & vbCrLf & | |
98 | + " . -ZO . " & vbCrLf & | |
99 | + " . . . " & vbCrLf & | |
100 | + "+ZO+LI+KI" & vbCrLf & | |
101 | + "100100" & vbCrLf & | |
102 | + "-" & vbCrLf | |
103 | + Assert.AreEqual(expected, target.ToString) | |
104 | + End Sub | |
89 | 105 | '''<summary> |
90 | 106 | '''CapturedKomaCount のテスト |
91 | 107 | '''</summary> |
@@ -157,7 +157,7 @@ | ||
157 | 157 | Dim capturedPiece As Koma = KomaUtil.CaputringKoma(GetCells(move.ToPos)) |
158 | 158 | If capturedPiece <> Koma.GoteLI AndAlso |
159 | 159 | capturedPiece <> Koma.SenteLI Then |
160 | - _Capured(CapuredKomaIndex(move.Koma)) += 1 | |
160 | + _Capured(CapuredKomaIndex(capturedPiece)) += 1 | |
161 | 161 | End If |
162 | 162 | End If |
163 | 163 | SetCells(move.ToPos, GetCells(move.FromPos)) |