1 package com.xtremelabs.robolectric.shadows; 2 3 import android.accounts.Account; 4 import android.content.PeriodicSync; 5 import android.os.Bundle; 6 import com.xtremelabs.robolectric.WithTestDefaultsRunner; 7 import org.junit.Test; 8 import org.junit.runner.RunWith; 9 10 import static org.hamcrest.CoreMatchers.equalTo; 11 import static org.hamcrest.CoreMatchers.is; 12 import static org.junit.Assert.assertNotNull; 13 import static org.junit.Assert.assertThat; 14 15 @RunWith(WithTestDefaultsRunner.class) 16 public class PeriodicSyncTest { 17 18 @Test 19 public void shouldHaveConstructor() throws Exception { 20 Account a = new Account("a", "b"); 21 PeriodicSync sync = new PeriodicSync(a, "auth", 22 new Bundle(), 120l); 23 24 assertThat(sync.account, is(a)); 25 assertThat(sync.authority, equalTo("auth")); 26 assertThat(sync.period, equalTo(120l)); 27 assertNotNull(sync.extras); 28 } 29 } 30