Skip to content

Instantly share code, notes, and snippets.

@wviana
Created May 24, 2016 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wviana/8e01423956f58bf2504f2cb14b03c10b to your computer and use it in GitHub Desktop.
Save wviana/8e01423956f58bf2504f2cb14b03c10b to your computer and use it in GitHub Desktop.
java.lang.RuntimeException: Method from in android.view.LayoutInflater not mocked. See http://g.co/androidstudio/not-mocked for details.
at android.view.LayoutInflater.from(LayoutInflater.java)
at neocom.dealerbook.views.LayerView.<init>(LayerView.java:174)
at neocom.dealerbook.views.LayerView.<init>(LayerView.java:125)
at neocom.dealerbook.views.LayerView.<init>(LayerView.java:33)
at neocom.dealerbook.views.LayerView$Builder.build(LayerView.java:101)
at LayerViewBuilderTest.test_addSelector(LayerViewBuilderTest.java:24)
import android.content.Context;
import android.test.mock.MockContext;
import org.junit.Test;
/**
* Created by wviana on 5/24/16.
*/
import neocom.dealerbook.views.LayerView;
import static junit.framework.Assert.*;
import static org.mockito.Mockito.*;
public class LayerViewBuilderTest {
@Test
public void test_addSelector() {
String[] selectorValues = {"2015", "2016", "2017"};
Context context = new MockContext();
LayerView view = new LayerView.Builder(context)
.addSelector(selectorValues)
.build();
assertNotNull(view);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment