コード例 #1
0
        public void WhenPlacingAPiece_ThenCallsWriter()
        {
            var spy = new BoardWriterSpy();
            var emptyBoardReaderStub = new EmptyBoardReaderStub();
            var placePiece           = new PlacePiece(spy, emptyBoardReaderStub);

            placePiece.Execute(0, 0);
            Assert.True(spy.Called);
        }
コード例 #2
0
        public void WhenPlacingTheFirstPiece_ThenUpdatesBoard(
            int x, int y,
            int?expectedPieceType, int expectedX, int expectedY)
        {
            var spy = new BoardWriterSpy();
            var emptyBoardReaderStub = new EmptyBoardReaderStub();
            var placePiece           = new PlacePiece(spy, emptyBoardReaderStub);

            placePiece.Execute(x, y);
            Assert.AreEqual(expectedPieceType, spy.LastBoard.PieceAt(expectedX, expectedY));
        }