Ejemplo n.º 1
0
        public void HistoryPresenter_OnClosing_WhileNotNormalWindow_Test()
        {
            // Arrange
            var r       = new Rectangle();
            var columns = new List <string>();

            _view.Expect(x => x.RestoreBounds).Return(r);
            _view.Expect(x => x.GetColumnSettings()).Return(columns);
            _view.Expect(x => x.WindowState).Return(FormWindowState.Minimized);
            // Act
            _presenter = CreatePresenter();
            _presenter.OnViewClosing();
            // Assert
            _view.VerifyAllExpectations();
            Assert.AreEqual(r.Location, _model.FormLocation);
            Assert.AreEqual(r.Size, _model.FormSize);
            Assert.AreEqual(columns, _model.FormColumns);
        }
Ejemplo n.º 2
0
        public void HistoryPresenter_OnClosing_Test()
        {
            // Arrange
            var p       = new Point();
            var s       = new Size();
            var columns = new List <string>();

            _view.Expect(x => x.Location).Return(p);
            _view.Expect(x => x.Size).Return(s);
            _view.Expect(x => x.GetColumnSettings()).Return(columns);
            _view.Expect(x => x.WindowState).Return(FormWindowState.Normal);
            // Act
            _presenter = CreatePresenter();
            _presenter.OnViewClosing();
            // Assert
            _view.VerifyAllExpectations();
            Assert.AreEqual(p, _model.FormLocation);
            Assert.AreEqual(s, _model.FormSize);
            Assert.AreEqual(columns, _model.FormColumns);
        }
Ejemplo n.º 3
0
 private void frmHistory_FormClosing(object sender, FormClosingEventArgs e)
 {
     _presenter.OnViewClosing();
 }