package cn.six.robolectric.notification;

import android.app.NotificationManager;
import android.content.Context;

import org.junit.Before;
import org.junit.Test;
import org.robolectric.shadows.ShadowNotificationManager;

import ca.six.aut.robolectric.BaseRoboTestCase;
import static junit.framework.Assert.assertEquals;
import static org.robolectric.Shadows.shadowOf;

public class NotificationUtilsTest extends BaseRoboTestCase {

    private ShadowNotificationManager shadow;

    @Before
    public void setUp() throws Exception {
        NotificationManager mgr = (NotificationManager)app.getSystemService(Context.NOTIFICATION_SERVICE);
        shadow = shadowOf(mgr);
    }

    @Test
    public void call_sendNotification(){
        assertEquals(shadow.size(), 0);

        NotificationUtils utils = new NotificationUtils();
        utils.showNotification(app);
        assertEquals(shadow.size(), 1);
    }
}
@@ -35,16 +35,49 @@
 ation;%0A%0A
+import android.app.Notification;%0A
 import a
@@ -940,10 +940,368 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void call_actionAllSend()%7B%0A        Notification notification = getNotification();%0A        assertEquals(notification.actions.length, 3);%0A    %7D%0A%0A    private Notification getNotification() %7BNotificationUtils utils = new NotificationUtils();%0A        utils.showNotification(app);%0A        return shadow.getAllNotifications().get(0);%0A    %7D%0A%0A%0A
 %0A%7D

add test for notification