1 package com.xtremelabs.robolectric.shadows;
2 
3 import android.R;
4 import android.app.Activity;
5 import android.view.animation.Animation;
6 import android.view.animation.AnimationUtils;
7 
8 import com.xtremelabs.robolectric.Robolectric;
9 import com.xtremelabs.robolectric.WithTestDefaultsRunner;
10 import org.junit.Test;
11 import org.junit.runner.RunWith;
12 
13 import static org.hamcrest.CoreMatchers.equalTo;
14 import static org.hamcrest.CoreMatchers.notNullValue;
15 import static org.junit.Assert.assertThat;
16 
17 @RunWith(WithTestDefaultsRunner.class)
18 public class AnimationUtilsTest {
19 
20 	@Test
testLoadAnimation()21 	public void testLoadAnimation() {
22 		assertThat(AnimationUtils.loadAnimation(new Activity(), 1), notNullValue());
23 	}
24 
25 	@Test
testLoadAnimationResourceId()26 	public void testLoadAnimationResourceId() {
27 		Animation anim = AnimationUtils.loadAnimation(new Activity(), R.anim.fade_in);
28 		assertThat(Robolectric.shadowOf(anim).getLoadedFromResourceId(), equalTo(R.anim.fade_in));
29 	}
30 }
31