From 5ee1f55497a4e30322a56f133f897ecde1612967 Mon Sep 17 00:00:00 2001 From: mo Date: Sun, 4 Nov 2018 15:22:16 -0700 Subject: initial commit. --- .../Model/Menu/File/Commands/ExitCommandSpecs.cs | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/Notepad/Presentation/Model/Menu/File/Commands/ExitCommandSpecs.cs (limited to 'src/Notepad/Presentation/Model/Menu/File/Commands/ExitCommandSpecs.cs') diff --git a/src/Notepad/Presentation/Model/Menu/File/Commands/ExitCommandSpecs.cs b/src/Notepad/Presentation/Model/Menu/File/Commands/ExitCommandSpecs.cs new file mode 100644 index 0000000..00855b6 --- /dev/null +++ b/src/Notepad/Presentation/Model/Menu/File/Commands/ExitCommandSpecs.cs @@ -0,0 +1,34 @@ +using MbUnit.Framework; +using Notepad.Infrastructure.System; +using Rhino.Mocks; + +namespace Notepad.Presentation.Model.Menu.File.Commands { + public class ExitCommandSpecs {} + + [TestFixture] + public class when_executing_the_exit_command_specs_ { + private MockRepository mockery; + private IApplicationEnvironment application; + + [SetUp] + public void SetUp() { + mockery = new MockRepository(); + application = mockery.DynamicMock(); + } + + [Test] + public void should_ask_the_application_environment_to_shut_down() { + using (mockery.Record()) { + application.ShutDown(); + } + + using (mockery.Playback()) { + CreateSUT().Execute(); + } + } + + private IExitCommand CreateSUT() { + return new ExitCommand(application); + } + } +} \ No newline at end of file -- cgit v1.2.3