public void TestGetLocationAt() { Factory chessModelFactory = (Factory)Ctx.GetObject("ChessModelFactory"); Board board = (Board)Ctx.GetObject("Board"); BoardImpl boardImpl = (BoardImpl)board; File file = File.FileA; Rank rank = Rank.Rank8; Location location = boardImpl.GetLocationAt(file, rank); Assert.IsNotNull(location); Assert.That(location.Shade, Is.EqualTo(Shade.Light)); }
public void TestGetPieceAt() { Factory chessModelFactory = (Factory)Ctx.GetObject("ChessModelFactory"); Board board = (Board)Ctx.GetObject("Board"); BoardImpl boardImpl = (BoardImpl)board; Piece piece = chessModelFactory.NewRook(Colour.Black); File file = File.FileA; Rank rank = Rank.Rank8; boardImpl.PlacePieceAt(piece, file, rank); Assert.AreEqual(piece, boardImpl.GetPieceAt(file, rank)); }
public void TestSetLocationAt() { Factory chessModelFactory = (Factory)Ctx.GetObject("ChessModelFactory"); Board board = (Board)Ctx.GetObject("Board"); BoardImpl boardImpl = (BoardImpl)board; Location location = chessModelFactory.NewLocation(Shade.Light); File file = File.FileA; Rank rank = Rank.Rank8; boardImpl.SetLocationAt(location, file, rank); Assert.AreEqual(location, boardImpl.GetLocationAt(file, rank)); }