public void SelectFigureTestStorage()
 {
     _storage.Setup(a => a.GetCount()).Returns(1);
     _storage.Setup(a => a.GetFigure(0)).Returns(new Line(_mouseHandler.GetPreviousMove(), _mouseHandler.GetMove(), _settings.Pen, _settings.SmoothingMode));
     _drawingEngine.SelectFigure();
     _storage.Verify(a => a.GetCount(), Times.Once);
 }
Beispiel #2
0
        private void PictureBoxPaint_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                drawingEngine.DrawMainOnBackground();
                mouseHandler.NewClick(e.Location);

                if (settings.Mode == EFigure.SmoothCurve)
                {
                    _isLineFinished = false;
                }
                if (!_isLineFinished && _isFirstPointAdd)
                {
                    drawingEngine.AddPointToCurve(mouseHandler.GetClick());
                }
                else if (!_isLineFinished && !_isFirstPointAdd)
                {
                    _isFirstPointAdd = true;
                }
                if (settings.Mode == EFigure.Dot)
                {
                    _isFigureCreated = true;
                    drawingEngine.DrawNewFigure();
                }
                else if (settings.Mode == EFigure.Move)
                {
                    drawingEngine.SelectFigure();
                }
                PictureBoxPaint.Image = drawingEngine.MainImage;
            }
            if (e.Button == MouseButtons.Right)
            {
                _isLineFinished  = true;
                _isFigureCreated = false;
                _isFirstPointAdd = false;
            }
        }