Let's say I want to make a Unit-Test where I have this Tetris game and I want to start the game, do nothing, and wait for the game to be over (this is, to get a GameOver event):
Tetris tetris = new Tetris();
tetris.GameOver += something;
tetris.Start();
How should I make the test? This should probably be easy but I can't see how to do it. My only idea would be something of the form:
Tetris tetris = new Tetris();
tetris.GameOver += delegate() { Assert.True(); };
tetris.Start();
Thanks