1package com.xtremelabs.robolectric.shadows; 2 3import android.app.Activity; 4import android.app.Notification; 5import android.app.PendingIntent; 6import android.content.Intent; 7import com.xtremelabs.robolectric.WithTestDefaultsRunner; 8import org.junit.Test; 9import org.junit.runner.RunWith; 10 11import static org.hamcrest.core.Is.is; 12import static org.junit.Assert.assertThat; 13 14@RunWith(WithTestDefaultsRunner.class) 15public class NotificationTest { 16 @Test 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