コード例 #1
0
    public void CalculatesNextEmpty()
    {
        var initial = new InitialHiveBuilder();

        initial += " ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ";
        initial += "⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡";
        initial += " ⬡ ⬡ ⬡ ⬡ ⬡ ⬢ ⬡ ⬡ ⬡ ";
        initial += "⬡ ⬡ ⬡ ⬡ ⬢ ⬢ ⬡ ⬡ ⬡ ⬡";
        initial += " ⬡ ⬡ ⬢ ⬢ ★ ⬢ ⬢ ⬡ ⬡ ";
        initial += "⬡ ⬡ ⬡ ⬡ ⬢ ⬢ ⬡ ⬡ ⬡ ⬡";
        initial += " ⬡ ⬡ ⬡ ⬡ ⬡ ⬢ ⬡ ⬡ ⬡ ";
        initial += "⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡";
        initial += " ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ";

        var expected = new ExpectedMovementBuilder();

        expected += " ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ";
        expected += "⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ✔ ⬡ ⬡ ⬡";
        expected += " ⬡ ⬡ ⬡ ✔ ⬡ ⬢ ⬡ ⬡ ⬡ ";
        expected += "⬡ ⬡ ⬡ ⬡ ⬢ ⬢ ⬡ ⬡ ⬡ ⬡";
        expected += " ⬡ ✔ ⬢ ⬢ ★ ⬢ ⬢ ✔ ⬡ ";
        expected += "⬡ ⬡ ⬡ ⬡ ⬢ ⬢ ⬡ ⬡ ⬡ ⬡";
        expected += " ⬡ ⬡ ⬡ ✔ ⬡ ⬢ ⬡ ⬡ ⬡ ";
        expected += "⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ✔ ⬡ ⬡ ⬡";
        expected += " ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ";

        var move = new OnlyJumpStraightOver();

        move.Should().HaveMoves(initial, expected);
    }
コード例 #2
0
    public void DoesntIncludeAdjacent()
    {
        var initial = new InitialHiveBuilder();

        initial += " ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ";
        initial += "⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡";
        initial += " ⬡ ⬡ ⬡ ⬡ ⬡ ⬢ ⬡ ⬡ ⬡ ";
        initial += "⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡";
        initial += " ⬡ ⬡ ⬢ ⬡ ★ ⬡ ⬢ ⬡ ⬡ ";
        initial += "⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡";
        initial += " ⬡ ⬡ ⬡ ⬡ ⬡ ⬢ ⬡ ⬡ ⬡ ";
        initial += "⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡";
        initial += " ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ";

        var expected = new ExpectedMovementBuilder();

        expected += " ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ";
        expected += "⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡";
        expected += " ⬡ ⬡ ⬡ ⬡ ⬡ ⬢ ⬡ ⬡ ⬡ ";
        expected += "⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡";
        expected += " ⬡ ⬡ ⬢ ⬡ ★ ⬡ ⬢ ⬡ ⬡ ";
        expected += "⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡";
        expected += " ⬡ ⬡ ⬡ ⬡ ⬡ ⬢ ⬡ ⬡ ⬡ ";
        expected += "⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡";
        expected += " ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ";

        var move = new OnlyJumpStraightOver();

        move.Should().HaveMoves(initial, expected);
    }
コード例 #3
0
    public void CreatesCellIfTheBoardIsNotLargeEnough()
    {
        var initial = new InitialHiveBuilder();

        initial += "⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡";
        initial += " ⬡ ⬡ ⬡ ★ ⬢ ⬢ ";
        initial += "⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡";

        var expected = new ExpectedMovementBuilder();

        expected += "⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡";
        expected += " ⬡ ⬡ ⬡ ★ ⬢ ⬢ ✔ ";
        expected += "⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡";

        var move = new OnlyJumpStraightOver();

        move.Should().HaveMoves(initial, expected);
    }