public void MouseMove_MouseMovingAndFirstPointNotClicked_PointNotAddded(bool leftButtonClick) { GraphPrimitive pen = getPen(); pen.MouseMove(leftButtonClick, false, new Point()); int countPoints = pen.Points.Count; Assert.AreEqual(countPoints, 0); }
public void MouseUp_ReleaseMouseButton_FireDrawPrimitiveInBitmapIfLeftPressed(bool leftButtonClick) { bool fired = false; GraphPrimitive pen = getPen(); pen.OnDrawPrimitiveInteractiveState += (points, p) => { fired = true; }; pen.MouseUp(leftButtonClick, false, new Point(1, 1)); Assert.AreEqual(fired, !leftButtonClick); }
public void MouseDown_AddingNewPoint_TrueAddedFlaseNotAdded(bool leftButtonClick) { int pointsNumber = 0; GraphPrimitive pen = getPen(); pen.OnDrawPrimitiveInteractiveState += (points, p) => { pointsNumber = points.Count; }; pen.MouseDown(leftButtonClick, false, new Point(1, 1)); Assert.AreEqual(pointsNumber, leftButtonClick ? 1 : 0); }
public void MouseMove_MouseMovingAndFirstPointAlreadyClickedAndLeftButtonNotPressed_PointNotAddded() { GraphPrimitive pen = getPen(); pen.Points.Add(new Point(0, 0)); pen.MouseMove(false, false, new Point(1, 1)); int countPoints = pen.Points.Count; Assert.AreEqual(countPoints, 0); }
public void MouseUp_ReleaseMouseLeftButton_PointListIsEmpty() { GraphPrimitive pen = getPen(); pen.Points.Add(new Point(0, 0)); pen.MouseUp(false, false, new Point(1, 1)); int countPoints = pen.Points.Count; Assert.AreEqual(countPoints, 0); }
public void MouseMove_MouseMovingAndFirstPointAlreadyClickedAndLeftButtonPressed_FireDrawPrimitiveInteractiveState() { int pointsNumber = 0; GraphPrimitive pen = getPen(); pen.OnDrawPrimitiveInteractiveState += (points, p) => { pointsNumber = points.Count; }; pen.Points.Add(new Point(0, 0)); pen.MouseMove(true, false, new Point(1, 1)); Assert.AreEqual(pointsNumber, 2); }
public void MouseMove_MouseMovingAndFirstPointAlreadyClickedAndLeftButtonNotPressed_FireDrawPrimitiveInBitmap() { int pointsNumber = 0; GraphPrimitive pen = getPen(); pen.OnDrawPrimitiveInBitmap += points => { pointsNumber = points.Count; }; pen.Points.Add(new Point(0, 0)); pen.MouseMove(false, false, new Point(1, 1)); Assert.AreEqual(pointsNumber, 1); }
public void MouseMove_MouseMovingAndFirstPointAlreadyClickedAndLeftButtonPressed_PointAddded() { GraphPrimitive pen = getPen(); pen.Points.Add(new Point(0, 0)); Point newPoint = new Point(1, 1); pen.MouseMove(true, false, newPoint); Point inList = pen.Points[1]; Assert.AreEqual(inList, newPoint); }