Skip to content

Commit

Permalink
Merge pull request #17 from dardino/test-performance-1
Browse files Browse the repository at this point in the history
Test performance 1
  • Loading branch information
dardino authored Aug 5, 2019
2 parents 72fdae9 + 885c579 commit 58e9cb3
Show file tree
Hide file tree
Showing 17 changed files with 69 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/Core/SP.Core.Test/BoardSquareTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace SP.Core.Test
public class BoardSqareTests
{
[TestMethod]
[Priority(1)]
public void ConversionTests()
{
BoardSquare p = new BoardSquare();
Expand All @@ -22,6 +23,7 @@ public void ConversionTests()
}

[TestMethod]
[Priority(1)]
public void GetSquareIndexTests() {
var indexA1 = BoardSquare.GetSquareIndex(Columns.ColA, Rows.Row1);
var indexA2 = BoardSquare.GetSquareIndex(Columns.ColA, Rows.Row2);
Expand Down
4 changes: 4 additions & 0 deletions src/Core/SP.Core.Test/BoardTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace SP.Core.Test
public class BoardTests
{
[TestMethod]
[Priority(1)]
public void FillBoardCellsOnConstructor()
{
var board = new Board();
Expand All @@ -21,6 +22,7 @@ public void FillBoardCellsOnConstructor()
Assert.AreEqual(p2.GetType(), typeof(Core.Pieces.Queen));
}
[TestMethod]
[Priority(1)]
public void LoadFromNotationAndStipulation()
{
var notation = "3QN3/2p1rr2/b2nkp2/1p3n2/3P4/1p2p1b1/pP2p1q1/2K5";
Expand All @@ -34,6 +36,7 @@ public void LoadFromNotationAndStipulation()
Assert.AreEqual(PieceColors.Black, board.Stipulation.StartingMoveColor, "check starting color");
}
[TestMethod]
[Priority(1)]
public void LoadFromNotation() {
var notation = "3QN3/2p1rr2/b2nkp2/1p3n2/3P4/1p2p1b1/pP2p1q1/2K5";
var board = BoardUtils.FromNotation(notation);
Expand Down Expand Up @@ -114,6 +117,7 @@ public void LoadFromNotation() {
}

[TestMethod]
[Priority(1)]
public void NeutralPieceFromFEN()
{
var notation = "8/8/8/*p7/8/8/8/8";
Expand Down
3 changes: 3 additions & 0 deletions src/Core/SP.Core.Test/CellTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace SP.Core.Test
public class CellTest
{
[TestMethod]
[Priority(1)]
public void TestOccupation()
{
var cell0 = new BoardSquare(0);
Expand All @@ -20,6 +21,7 @@ public void TestOccupation()
}

[TestMethod]
[Priority(1)]
public void TestRows()
{
var cell0 = new BoardSquare(0);
Expand All @@ -31,6 +33,7 @@ public void TestRows()
}

[TestMethod]
[Priority(1)]
public void TestColumns()
{
var cell0 = new BoardSquare(0);
Expand Down
2 changes: 2 additions & 0 deletions src/Core/SP.Core.Test/Pieces/PieceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace SP.Core.Test.Pieces
public class PieceTests
{
[TestMethod]
[Priority(1)]
public void TestPieceTypesCount()
{
var p = new Core.Pieces.Bishop();
Expand All @@ -20,6 +21,7 @@ public void TestPieceTypesCount()
}

[TestMethod]
[Priority(1)]
public void TestPieceTypes()
{
var p = PieceBaseUtils.FromFEN("K+ ");
Expand Down
2 changes: 2 additions & 0 deletions src/Core/SP.Core.Test/SquareTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace SP.Core.Test
public class SquareTest
{
[TestMethod]
[Priority(1)]
public void TestGetColumn()
{
var sq1 = Square.A1.GetColumn();
Expand All @@ -31,6 +32,7 @@ public void TestGetColumn()
Assert.AreEqual(Columns.ColH, sq8);
}
[TestMethod]
[Priority(1)]
public void TestGetRow()
{
var sq1 = Square.A1.GetRow();
Expand Down
1 change: 1 addition & 0 deletions src/Core/SP.Core.Test/StipulationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class StipulationTest
{

[TestMethod]
[Priority(1)]
public void TestStartingColor()
{

Expand Down
1 change: 1 addition & 0 deletions src/Core/SP.Engine.Test/BoardSquareTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class BoardSqareTests
{

[TestMethod]
[Priority(1)]
public void ConversionTestsBits()
{
Assert.AreEqual(Square.H1.ToSquareBits(), (ulong)SquareBits.H1, "SquareBits.H1");
Expand Down
7 changes: 7 additions & 0 deletions src/Core/SP.Engine.Test/GameStateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace SP.Engine.Test
public class GameStateTests
{
[TestMethod]
[Priority(1)]
public void GameStateGenerator()
{
// ---------------------------------
Expand Down Expand Up @@ -48,6 +49,7 @@ public void GameStateGenerator()
}

[TestMethod]
[Priority(1)]
public void GameStateGetListOfMoves()
{
var tokenSource = new CancellationTokenSource();
Expand All @@ -62,6 +64,7 @@ public void GameStateGetListOfMoves()
}

[TestMethod]
[Priority(1)]
public void GameStateNoMovesBecausePinned()
{
var tokenSource = new CancellationTokenSource();
Expand All @@ -74,6 +77,7 @@ public void GameStateNoMovesBecausePinned()
}

[TestMethod]
[Priority(1)]
public void GameStateClone()
{
var tokenSource = new CancellationTokenSource();
Expand Down Expand Up @@ -128,6 +132,7 @@ public void GameStateClone()
}

[TestMethod]
[Priority(1)]
public void GameStateApplyMoveKing() {
var board1 = BoardUtils.FromNotation("8/8/8/8/8/8/8/R3K3");
var board2 = BoardUtils.FromNotation("8/8/8/8/8/8/8/R3K3");
Expand Down Expand Up @@ -170,6 +175,7 @@ public void GameStateApplyMoveKing() {


[TestMethod]
[Priority(1)]
public void GameStateApplyMovePawn()
{
var board1 = BoardUtils.FromNotation("8/2P5/8/8/8/8/8/8");
Expand All @@ -192,6 +198,7 @@ public void GameStateApplyMovePawn()


[TestMethod]
[Priority(1)]
public void GameStateActualDepth()
{
var board1 = BoardUtils.FromNotation("8/2P5/8/8/8/8/8/8");
Expand Down
5 changes: 5 additions & 0 deletions src/Core/SP.Engine.Test/Pieces/BishopMovesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class BishopMovesTests
};

[TestMethod]
[Priority(1)]
public void B_MoveInABlankBoard()
{

Expand Down Expand Up @@ -76,6 +77,7 @@ public void B_MoveInABlankBoard()
}

[TestMethod]
[Priority(1)]
public void B_MoveInOccupiedBoard() {

var piece = new Bishop();
Expand All @@ -90,6 +92,7 @@ public void B_MoveInOccupiedBoard() {
}

[TestMethod]
[Priority(1)]
public void B_CapturesTest()
{

Expand All @@ -103,6 +106,7 @@ public void B_CapturesTest()
}

[TestMethod]
[Priority(1)]
public void B_IsAttackingSquare() {

var tokenSource = new CancellationTokenSource();
Expand All @@ -120,6 +124,7 @@ public void B_IsAttackingSquare() {

}
[TestMethod]
[Priority(1)]
public void B_IsAttackingSquareOnBoard()
{

Expand Down
1 change: 1 addition & 0 deletions src/Core/SP.Engine.Test/Pieces/BitboardTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace SP.Engine.Test.Pieces
public class BitboardTests
{
[TestMethod]
[Priority(1)]
public void TestToSquareList()
{
var bb = BitBoardUtils.FromRowBytes(
Expand Down
10 changes: 5 additions & 5 deletions src/Core/SP.Engine.Test/Pieces/CommonUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace SP.Engine.Test.Pieces
public class CommonUtils
{
[TestMethod]
[Priority(1)]
public void DiagonalA1H8CalcTest()
{
ulong Exp_a2 = 0x204081020408000;
Expand All @@ -34,6 +35,7 @@ public void DiagonalA1H8CalcTest()
}

[TestMethod]
[Priority(1)]
public void DiagonalA8H1CalcTest()
{
ulong Exp_a2 = 0x8040;
Expand Down Expand Up @@ -63,6 +65,7 @@ public void DiagonalA8H1CalcTest()
}

[TestMethod]
[Priority(1)]
public void GetDiagonals()
{

Expand Down Expand Up @@ -101,6 +104,7 @@ public void GetDiagonals()
}

[TestMethod]
[Priority(1)]
public void GetColumns()
{
ulong[] exps = new ulong[8];
Expand All @@ -125,6 +129,7 @@ public void GetColumns()
}
}

[Priority(1)]
[TestMethod]
public void GetRows()
{
Expand All @@ -150,10 +155,5 @@ public void GetRows()
}
}

[TestMethod]
public void TestHashKey() {

}

}
}
4 changes: 4 additions & 0 deletions src/Core/SP.Engine.Test/Pieces/HorseMovesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class HorseMovesTests
};

[TestMethod]
[Priority(1)]
public void H_MoveInABlankBoard()
{

Expand Down Expand Up @@ -78,6 +79,7 @@ public void H_MoveInABlankBoard()
}

[TestMethod]
[Priority(1)]
public void H_MoveInOccupiedBoard() {

var piece = new Horse();
Expand Down Expand Up @@ -112,6 +114,7 @@ public void H_MoveInOccupiedBoard() {
}

[TestMethod]
[Priority(1)]
public void H_CapturesTest()
{

Expand All @@ -125,6 +128,7 @@ public void H_CapturesTest()
}

[TestMethod]
[Priority(1)]
public void H_IsAttackingSquare() {

var piece = new Horse();
Expand Down
11 changes: 11 additions & 0 deletions src/Core/SP.Engine.Test/Pieces/KingMovesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class KingMovesTests


[TestMethod]
[Priority(1)]
public void K_MoveInABlankBoard()
{

Expand Down Expand Up @@ -82,6 +83,7 @@ public void K_MoveInABlankBoard()
}

[TestMethod]
[Priority(1)]
public void K_MoveInOccupiedBoard()
{

Expand All @@ -105,6 +107,7 @@ public void K_MoveInOccupiedBoard()
}

[TestMethod]
[Priority(1)]
public void K_CapturesTest()
{

Expand All @@ -118,6 +121,7 @@ public void K_CapturesTest()
}

[TestMethod]
[Priority(1)]
public void K_IsAttackingSquare()
{

Expand All @@ -128,6 +132,7 @@ public void K_IsAttackingSquare()
}

[TestMethod]
[Priority(1)]
public void K_FreeCastling()
{
var wk = new King() { Color = PieceColors.White };
Expand All @@ -151,6 +156,7 @@ public void K_FreeCastling()
}

[TestMethod]
[Priority(1)]
public void K_NoCastling1()
{
var tokenSource = new CancellationTokenSource();
Expand All @@ -171,6 +177,7 @@ public void K_NoCastling1()
}

[TestMethod]
[Priority(1)]
public void K_NoCastling2()
{
var wk = new King() { Color = PieceColors.White };
Expand Down Expand Up @@ -198,6 +205,7 @@ public void K_NoCastling2()
}

[TestMethod]
[Priority(1)]
public void K_NoCastling3()
{
var wk = new King() { Color = PieceColors.White };
Expand All @@ -223,6 +231,7 @@ public void K_NoCastling3()
}

[TestMethod]
[Priority(1)]
public void K_NoCastling4()
{
var tokenSource = new CancellationTokenSource();
Expand All @@ -234,6 +243,7 @@ public void K_NoCastling4()


[TestMethod]
[Priority(1)]
public void K_CastlingSubMovesWhite()
{
var tokenSource = new CancellationTokenSource();
Expand Down Expand Up @@ -261,6 +271,7 @@ public void K_CastlingSubMovesWhite()
}

[TestMethod]
[Priority(1)]
public void K_CastlingSubMovesBlack()
{
var tokenSource = new CancellationTokenSource();
Expand Down
Loading

0 comments on commit 58e9cb3

Please sign in to comment.