diff options
Diffstat (limited to 'src/Notepad/Presentation/Presenters/Shell')
3 files changed, 58 insertions, 0 deletions
diff --git a/src/Notepad/Presentation/Presenters/Shell/IMainShellPresenter.cs b/src/Notepad/Presentation/Presenters/Shell/IMainShellPresenter.cs new file mode 100644 index 0000000..c0ed3e9 --- /dev/null +++ b/src/Notepad/Presentation/Presenters/Shell/IMainShellPresenter.cs @@ -0,0 +1,5 @@ +using Notepad.Presentation.Core;
+
+namespace Notepad.Presentation.Presenters.Shell {
+ public interface IMainShellPresenter : IPresenter {}
+}
\ No newline at end of file diff --git a/src/Notepad/Presentation/Presenters/Shell/MainShellPresenter.cs b/src/Notepad/Presentation/Presenters/Shell/MainShellPresenter.cs new file mode 100644 index 0000000..1406be0 --- /dev/null +++ b/src/Notepad/Presentation/Presenters/Shell/MainShellPresenter.cs @@ -0,0 +1,17 @@ +using Notepad.Presentation.Core;
+using Notepad.Presentation.Presenters.Menu;
+using Notepad.Presentation.Presenters.Shell;
+
+namespace Notepad.Presentation.Presenters.Shell {
+ public class MainShellPresenter : IMainShellPresenter {
+ private readonly IApplicationController applicationController;
+
+ public MainShellPresenter(IApplicationController applicationController) {
+ this.applicationController = applicationController;
+ }
+
+ public void Initialize() {
+ applicationController.Run<IMainMenuPresenter>();
+ }
+ }
+}
\ No newline at end of file diff --git a/src/Notepad/Presentation/Presenters/Shell/MainShellPresenterSpecs.cs b/src/Notepad/Presentation/Presenters/Shell/MainShellPresenterSpecs.cs new file mode 100644 index 0000000..681ce58 --- /dev/null +++ b/src/Notepad/Presentation/Presenters/Shell/MainShellPresenterSpecs.cs @@ -0,0 +1,36 @@ +using MbUnit.Framework;
+using Notepad.Presentation.Core;
+using Notepad.Presentation.Presenters.Menu;
+using Notepad.Presentation.Presenters.Shell;
+using Rhino.Mocks;
+
+namespace Notepad.Presentation.Presenters.Shell {
+ public class MainShellPresenterSpecs {}
+
+ [TestFixture]
+ public class when_initializing_the_main_shell_presenter_ {
+ private MockRepository mockery;
+ private IApplicationController applicationController;
+
+ [SetUp]
+ public void SetUp() {
+ mockery = new MockRepository();
+ applicationController = mockery.DynamicMock<IApplicationController>();
+ }
+
+ [Test]
+ public void should_initialize_the_main_menu_presenter() {
+ using (mockery.Record()) {
+ applicationController.Run<IMainMenuPresenter>();
+ }
+
+ using (mockery.Playback()) {
+ CreateSUT().Initialize();
+ }
+ }
+
+ private IMainShellPresenter CreateSUT() {
+ return new MainShellPresenter(applicationController);
+ }
+ }
+}
\ No newline at end of file |
