it fricken works!
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using FluentAssertions;
|
||||
using Gameboard.ShogiUI.BoardState;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
|
||||
@@ -304,15 +305,22 @@ namespace Gameboard.ShogiUI.UnitTests.BoardState
|
||||
new Move { From = new Vector2(4, 4), To = new Vector2(4, 5) },
|
||||
// P2 King
|
||||
new Move { From = new Vector2(4, 8), To = new Vector2(4, 7) },
|
||||
// P1 Pawn promotes
|
||||
// P1 Pawn promotes, threatens P2 King
|
||||
new Move { From = new Vector2(4, 5), To = new Vector2(4, 6), IsPromotion = true },
|
||||
// P2 King retreat
|
||||
new Move { From = new Vector2(4, 7), To = new Vector2(4, 8) },
|
||||
};
|
||||
var shogi = new ShogiBoard(moves);
|
||||
Console.WriteLine("Prereq");
|
||||
shogi.PrintStateAsAscii();
|
||||
|
||||
// Act - P1 Pawn wins by checkmate.
|
||||
var moveSuccess = shogi.Move(new Move { From = new Vector2(4, 6), To = new Vector2(4, 7) });
|
||||
Console.WriteLine("Checkmate");
|
||||
shogi.PrintStateAsAscii();
|
||||
|
||||
shogi.Move(new Move { From = new Vector2(4, 8), To = new Vector2(4, 7) });
|
||||
shogi.PrintStateAsAscii();
|
||||
|
||||
// Assert
|
||||
moveSuccess.Should().BeTrue();
|
||||
|
||||
Reference in New Issue
Block a user