Skip to content

Instantly share code, notes, and snippets.

@ElemarJR
Created January 7, 2011 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ElemarJR/769456 to your computer and use it in GitHub Desktop.
Save ElemarJR/769456 to your computer and use it in GitHub Desktop.
// Este teste verifica o bit mais alto ligado em um bitboard
// (ver minha série sobre xadrez [http://elemarjr.net]) para entender o contexto
// Não só mais de um assert faz sentido, como a lógica no teste
// O equivalente a esse teste seriam 64 testes individuais (muito trabalho para pouco resultado, não acha)
[Test]
public void GetLeadingSquare_EverySquare()
{
var bitboard = new Bitboard();
for (int i = 0; i < 64; i++)
{
var sq = new Square(i);
bitboard = bitboard.Set(sq);
bitboard.LeadingSquare.Value.Should().Be(sq);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment