Home | History | Annotate | Download | only in shadows
      1 package com.xtremelabs.robolectric.shadows;
      2 
      3 import android.content.ContextWrapper;
      4 import android.view.LayoutInflater;
      5 import com.xtremelabs.robolectric.Robolectric;
      6 import com.xtremelabs.robolectric.WithTestDefaultsRunner;
      7 import org.junit.Before;
      8 import org.junit.Test;
      9 import org.junit.runner.RunWith;
     10 
     11 import static org.junit.Assert.assertNotNull;
     12 import static org.junit.Assert.assertSame;
     13 
     14 @RunWith(WithTestDefaultsRunner.class)
     15 public class LayoutInflaterTest {
     16     private LayoutInflater layoutInflater;
     17 
     18     @Before
     19     public void setUp() throws Exception {
     20         layoutInflater = LayoutInflater.from(Robolectric.application);
     21     }
     22 
     23     @Test
     24     public void getInstance_shouldReturnSameInstance() throws Exception {
     25         assertNotNull(layoutInflater);
     26         assertSame(LayoutInflater.from(Robolectric.application), layoutInflater);
     27         assertSame(LayoutInflater.from(new ContextWrapper(Robolectric.application)), layoutInflater);
     28     }
     29 }
     30