Home | History | Annotate | Download | only in shadows
      1 package com.xtremelabs.robolectric.shadows;
      2 
      3 import android.view.animation.AlphaAnimation;
      4 import com.xtremelabs.robolectric.WithTestDefaultsRunner;
      5 import org.junit.Test;
      6 import org.junit.runner.RunWith;
      7 
      8 import static com.xtremelabs.robolectric.Robolectric.shadowOf;
      9 import static junit.framework.Assert.assertEquals;
     10 
     11 @RunWith(WithTestDefaultsRunner.class)
     12 public class AlphaAnimationTest {
     13     @Test
     14     public void getFromAlpha_shouldReturnTheFromAlphaThatWasPassedToTheConstructor() throws Exception {
     15         assertEquals(99.0f, shadowOf(new AlphaAnimation(99, 88)).getFromAlpha());
     16         assertEquals(66.7f, shadowOf(new AlphaAnimation(66.7f, 88)).getFromAlpha());
     17     }
     18 
     19     @Test
     20     public void getToAlpha_shouldReturnTheToAlphaThatWasPassedToTheConstructor() throws Exception {
     21         assertEquals(88.0f, shadowOf(new AlphaAnimation(99, 88)).getToAlpha());
     22         assertEquals(98f, shadowOf(new AlphaAnimation(66.7f, 98)).getToAlpha());
     23     }
     24 }
     25