package io.github.data4all.model.drawing;

import static org.mockito.Matchers.anyFloat;
import static org.mockito.Matchers.anyObject;
import static org.mockito.Mockito.verify;

import org.mockito.verification.VerificationMode;

import android.graphics.Canvas;
import android.graphics.Paint;

/**
 * Test-utils for theclasses implementing MotionInterpreter
 * 
 * @author tbrose
 */
public abstract class MotionInterpreterTest {
    protected static void verifyDrawCircle(Canvas canvas, VerificationMode mode) {
        verify(canvas, mode).drawCircle(anyFloat(), anyFloat(), anyFloat(),
                (Paint) anyObject());
    }

    protected static void verifyDrawLine(Canvas canvas, VerificationMode mode) {
        verify(canvas, mode).drawLine(anyFloat(), anyFloat(), anyFloat(),
                anyFloat(), (Paint) anyObject());
    }

    protected static DrawingMotion getDrawingMotion(float... points) {
        DrawingMotion motion = new DrawingMotion();
        for (int i = 0; i < points.length; i = i + 2) {
            motion.addPoint(points[i], points[i + 1]);
        }
        return motion;
    }
}

@@ -81,16 +81,55 @@
 yFloat;%0A
+import static org.mockito.Matchers.eq;%0A
 import s
@@ -166,16 +166,16 @@
 Object;%0A
-
 import s
@@ -340,16 +340,20 @@
 est-util
+itie
 s for th
@@ -353,16 +353,17 @@
  for the
+ 
 classes 
@@ -465,16 +465,824 @@
 rTest %7B%0A
+    /**%0A     * Verify if the drawCircle method is called mode-often with the given%0A     * coordinates%0A     * %0A     * @param canvas%0A     *            The canvas mock%0A     * @param mode%0A     *            The verification mode%0A     * @param x%0A     *            The x coordinate to verify%0A     * @param y%0A     *            The y coordinate to verify%0A     */%0A    protected static void verifyDrawCircle(Canvas canvas,%0A            VerificationMode mode, float x, float y) %7B%0A        verify(canvas, mode).drawCircle(eq(x), eq(y), anyFloat(),%0A                (Paint) anyObject());%0A    %7D%0A%0A    /**%0A     * Verify if the drawCircle method is called mode-often with the any%0A     * coordinates%0A     * %0A     * @param canvas%0A     *            The canvas mock%0A     * @param mode%0A     *            The verification mode%0A     */%0A
     prot
@@ -1469,32 +1469,228 @@
 ject());%0A    %7D%0A%0A
+    /**%0A     * Verify if the drawLine method is called mode-often%0A     * %0A     * @param canvas%0A     *            The canvas mock%0A     * @param mode%0A     *            The verification mode%0A     */%0A
     protected st
@@ -1881,24 +1881,513 @@
 ());%0A    %7D%0A%0A
+    /**%0A     * Constructs a DrawingMotion with the given coordinate-pairs %3Cbr/%3E%0A     * %0A     * The length of points %3Cb%3Eneeds to be even%3C/b%3E, but %3Cb%3Eis NOT checked%3C/b%3E%0A     * by this method!%3Cbr/%3E%0A     * %0A     * Every float in points with an odd index i is the x coordinate of the%0A     * point with index (i-1)/2%3Cbr/%3E%0A     * float with%0A     * %0A     * Every float in points with an even index j is the y coordinate of the%0A     * point with index j/2%3Cbr/%3E%0A     * %0A     * @param points%0A     */%0A
     protecte

Edit implementation caused an test-failure refs #2584