public void TestClipRectangle(float x, float y, float w, float h) { var rect = new RectF(x, y, w, h); var drawable = new RippleEffectDrawable(); drawable.ClipRectangle = rect; Assert.Equal(rect, drawable.ClipRectangle); }
public void TestTrackRect(float x, float y, float w, float h) { var rect = new RectF(x, y, w, h); var view = new Mock <ISlider>(); var drawable = new SliderDrawable(view.Object); drawable.TrackRect = rect; Assert.Equal(rect, drawable.TrackRect); }
public void TestDraw(float x, float y, float w, float h, float pointX, float pointY) { var canvas = new Mock <ICanvas>(); var rect = new RectF(x, y, w, h); var point = new PointF(pointX, pointY); var drawable = new RippleEffectDrawable { ClipRectangle = rect, TouchPoint = point }; var exception = Record.Exception(() => { drawable.Draw(canvas.Object, new RectF(x, y, w, h)); }); Assert.Null(exception); }
public void TestOnTouchUpDown(float x, float y, float w, float h, float pointX, float pointY) { var rect = new RectF(x, y, w, h); var point = new PointF(pointX, pointY); var drawable = new RippleEffectDrawable { ClipRectangle = rect, TouchPoint = point }; var exception = Record.Exception(() => { var point = new GPoint(10, 10); drawable.OnTouchDown(point); drawable.OnTouchUp(point); }); Assert.Null(exception); }
public void TestOnTouchUpMoveDown(float x, float y, float w, float h, float pointX, float pointY) { var view = new Mock <ISlider>(); var drawable = new SliderDrawable(view.Object); var rect = new RectF(x, y, w, h); drawable.ThumbRect = rect; Assert.Equal(rect, drawable.ThumbRect); var exception = Record.Exception(() => { var point = new GPoint(pointX, pointY); drawable.OnTouchDown(point); drawable.OnTouchMove(point); drawable.OnTouchUp(point); }); Assert.Null(exception); }