summaryrefslogtreecommitdiff
path: root/src/Notepad/Presentation/Model/Menu/File/Commands/ExitCommandSpecs.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Notepad/Presentation/Model/Menu/File/Commands/ExitCommandSpecs.cs')
-rw-r--r--src/Notepad/Presentation/Model/Menu/File/Commands/ExitCommandSpecs.cs34
1 files changed, 34 insertions, 0 deletions
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<IApplicationEnvironment>();
+ }
+
+ [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