aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/xtremelabs/robolectric/shadows/LayoutInflaterTest.java
blob: e870efa3c957f300df2c4b7b51d83e3567948377 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.xtremelabs.robolectric.shadows;

import android.content.ContextWrapper;
import android.view.LayoutInflater;
import com.xtremelabs.robolectric.Robolectric;
import com.xtremelabs.robolectric.WithTestDefaultsRunner;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;

@RunWith(WithTestDefaultsRunner.class)
public class LayoutInflaterTest {
    private LayoutInflater layoutInflater;

    @Before
    public void setUp() throws Exception {
        layoutInflater = LayoutInflater.from(Robolectric.application);
    }

    @Test
    public void getInstance_shouldReturnSameInstance() throws Exception {
        assertNotNull(layoutInflater);
        assertSame(LayoutInflater.from(Robolectric.application), layoutInflater);
        assertSame(LayoutInflater.from(new ContextWrapper(Robolectric.application)), layoutInflater);
    }
}