blob: 00855b6f4d833e158692f891e104b93a7ecb458d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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);
}
}
}
|