1 package com.xtremelabs.robolectric.shadows; 2 3 import android.app.Activity; 4 import android.app.Notification; 5 import android.app.PendingIntent; 6 import android.content.Intent; 7 import com.xtremelabs.robolectric.WithTestDefaultsRunner; 8 import org.junit.Test; 9 import org.junit.runner.RunWith; 10 11 import static org.hamcrest.core.Is.is; 12 import static org.junit.Assert.assertThat; 13 14 @RunWith(WithTestDefaultsRunner.class) 15 public class NotificationTest { 16 @Test setLatestEventInfo__shouldCaptureContentIntent()17 public void setLatestEventInfo__shouldCaptureContentIntent() throws Exception { 18 PendingIntent pendingIntent = PendingIntent.getActivity(new Activity(), 0, new Intent(), 0); 19 Notification notification = new Notification(); 20 notification.setLatestEventInfo(new Activity(), "title", "content", pendingIntent); 21 assertThat(pendingIntent, is(notification.contentIntent)); 22 } 23 } 24