Example #1
0
        public void QuitsTheGame()
        {
            IGame stubGame = MockRepository.GenerateStub<IGame>();
            Quitter quitter = new Quitter(MockRepository.GenerateStub<ISettingsPersister>(), stubGame);

            quitter.Quit();

            stubGame.AssertWasCalled(me => me.Exit());
        }
Example #2
0
        public void SavesSettingsBeforeQuit()
        {
            ISettingsPersister stubSettingsSaver = MockRepository.GenerateStub<ISettingsPersister>();
            Quitter quitter = new Quitter(stubSettingsSaver, MockRepository.GenerateStub<IGame>());

            quitter.Quit();

            stubSettingsSaver.AssertWasCalled(me => me.SaveSettings());
        }