Пример #1
0
    public void TestOnGameStartCallsIsPlayersTurn()
    {
        // Given
        var viewSpy  = new ViewSpy();
        var sut      = new Presenter(viewSpy);
        var modelSpy = new ModelSpy();

        sut.model = modelSpy;

        // When
        sut.StartNewGame();

        // Then
        Assert.IsTrue(modelSpy.isPlayersTurnWasCalled, "Starting a new game " +
                      "should check whose turn it is");
    }
Пример #2
0
    public void TestRecordPlayerMoveCallsRecordPlayerMove()
    {
        // Given
        var viewSpy  = new ViewSpy();
        var sut      = new Presenter(viewSpy);
        var modelSpy = new ModelSpy();

        sut.model = modelSpy;

        sut.StartNewGame();

        // When
        sut.RecordPlayerMove(0);

        // Then
        Assert.IsTrue(modelSpy.recordPlayerMoveWasCalled, "The presenter being " +
                      "asked to record a player move, should call the same on the model");
    }