Esempio n. 1
0
    public void ShouldRemoveOnGameOverEventWhenFinish()
    {
        gameServer.Register(gridOne);
        gameServer.Register(gridTwo);

        gameServer.StartNewGame();

        gridOne.Received().OnGameOverEvent += Arg.Any <OnGameOverEventHandler>();
        gridTwo.Received().OnGameOverEvent += Arg.Any <OnGameOverEventHandler>();

        gameServer.FinishGame();

        gridOne.Received().OnGameOverEvent -= Arg.Any <OnGameOverEventHandler>();
        gridTwo.Received().OnGameOverEvent -= Arg.Any <OnGameOverEventHandler>();
    }