package com.sdoward.rxgooglemap;

import com.google.android.gms.maps.GoogleMap;
import com.sdoward.rxgooglemap.events.DragEvent;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.*;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import rx.observers.TestSubscriber;

import static org.mockito.Mockito.verify;

@RunWith(PowerMockRunner.class)
@PrepareForTest(GoogleMap.class)
public class MarkerDragFuncTest {

    @Mock
    private GoogleMap googleMap;
    @Captor
    private ArgumentCaptor<GoogleMap.OnMarkerDragListener> argumentCaptor;

    @Test
    public void shouldEmmitDragEvent() throws Exception {
        TestSubscriber<DragEvent> testSubscriber = new TestSubscriber<>();
        new MarkerDragFunc().call(googleMap)
                .subscribe(testSubscriber);
        verify(googleMap).setOnMarkerDragListener(argumentCaptor.capture());
        argumentCaptor.getValue().onMarkerDrag(null);
        testSubscriber.assertNoErrors();
        testSubscriber.assertValueCount(1);
        argumentCaptor.getValue().onMarkerDrag(null);
        testSubscriber.assertValueCount(2);
    }

}
@@ -1185,9 +1185,1139 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void shouldEmmitStartDragEvent() throws Exception %7B%0A        TestSubscriber%3CDragEvent%3E testSubscriber = new TestSubscriber%3C%3E();%0A        new MarkerDragFunc().call(googleMap)%0A                .subscribe(testSubscriber);%0A        verify(googleMap).setOnMarkerDragListener(argumentCaptor.capture());%0A        argumentCaptor.getValue().onMarkerDragStart(null);%0A        testSubscriber.assertNoErrors();%0A        testSubscriber.assertValueCount(1);%0A        argumentCaptor.getValue().onMarkerDragStart(null);%0A        testSubscriber.assertValueCount(2);%0A    %7D%0A%0A    @Test%0A    public void shouldEmmitEndDragEvent() throws Exception %7B%0A        TestSubscriber%3CDragEvent%3E testSubscriber = new TestSubscriber%3C%3E();%0A        new MarkerDragFunc().call(googleMap)%0A                .subscribe(testSubscriber);%0A        verify(googleMap).setOnMarkerDragListener(argumentCaptor.capture());%0A        argumentCaptor.getValue().onMarkerDragEnd(null);%0A        testSubscriber.assertNoErrors();%0A        testSubscriber.assertValueCount(1);%0A        argumentCaptor.getValue().onMarkerDragEnd(null);%0A        testSubscriber.assertValueCount(2);%0A    %7D%0A%0A
 %7D

Add tests for drag start and end