Пример #1
0
        public void test_MouseUpSendsTheEventToMainFormState()
        {
            _formState = new Mock <MainFormState>();
            _formState.Setup(x => x.UpdateState(It.IsAny <Point>(), It.IsAny <StateChangingTrigger>()));

            Type t     = typeof(MainFormViewModel);
            var  field = t.GetField("_currentState", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);

            field.SetValue(_model, _formState.Object);

            Point p = new Point(1, 1);

            _model.MouseUp(p, MouseButtons.Left);
            _formState.Verify(x => x.UpdateState(p, StateChangingTrigger.MouseUp));
        }
Пример #2
0
 private void overlayBox_MouseUp(object sender, MouseEventArgs e)
 {
     _model.MouseUp(TranslateCursorLocation(), e.Button);
 }