summaryrefslogtreecommitdiff
path: root/src/Notepad/Presentation/Presenters/Shell
diff options
context:
space:
mode:
authormo <mo.khan@gmail.com>2018-11-04 15:22:16 -0700
committermo <mo.khan@gmail.com>2018-11-04 15:22:16 -0700
commit5ee1f55497a4e30322a56f133f897ecde1612967 (patch)
treebf544e0879234c3623869627d8786776cb19b8e9 /src/Notepad/Presentation/Presenters/Shell
initial commit.HEADmaster
Diffstat (limited to 'src/Notepad/Presentation/Presenters/Shell')
-rw-r--r--src/Notepad/Presentation/Presenters/Shell/IMainShellPresenter.cs5
-rw-r--r--src/Notepad/Presentation/Presenters/Shell/MainShellPresenter.cs17
-rw-r--r--src/Notepad/Presentation/Presenters/Shell/MainShellPresenterSpecs.cs36
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