コード例 #1
0
        public void CloseTheScreenWhenTheScreenIsNotDirty()
        {
            using (mocks.Record())
            {
                Expect.Call(view.IsDirty()).Return(false);
                view.Close();
            }

            using (mocks.Playback())
            {
                OverseerPresenter presenter = new OverseerPresenter(view);
                presenter.Close();
            }
        }
コード例 #2
0
        public void CloseTheScreenWhenTheScreenIsNotDirty()
        {
            using (mocks.Record())
            {
                Expect.Call(view.IsDirty()).Return(false);
                view.Close();
            }

            using (mocks.Playback())
            {
                OverseerPresenter presenter = new OverseerPresenter(view);
                presenter.Close();
            }
        }
コード例 #3
0
        public void CloseTheScreenWhenTheScreenIsDirtyAndTheUserDecidesToDiscardTheChanges()
        {
            using (mocks.Record())
            {
                Expect.Call(view.IsDirty()).Return(true);
                Expect.Call(view.AskUserToDiscardChanges()).Return(true);
                view.Close();
            }

            using (mocks.Playback())
            {
                OverseerPresenter presenter = new OverseerPresenter(view);
                presenter.Close();
            }
        }
コード例 #4
0
        public void CloseTheScreenWhenTheScreenIsDirtyAndTheUserDecidesToDiscardTheChanges()
        {
            using (mocks.Record())
            {
                Expect.Call(view.IsDirty()).Return(true);
                Expect.Call(view.AskUserToDiscardChanges()).Return(true);
                view.Close();
            }

            using (mocks.Playback())
            {
                OverseerPresenter presenter = new OverseerPresenter(view);
                presenter.Close();
            }
        }