This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestLayoutInflater extends LayoutInflater { | |
private int resource; | |
private ViewGroup root; | |
TestLayoutInflater(Context context) { | |
super(context); | |
} | |
@Override public View inflate(int resource, ViewGroup root) { | |
this.resource = resource; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MapView extends RelativeLayout { | |
private static final String MAPZEN_RIGHTS = "https://mapzen.com/rights/"; | |
public static final int OVERLAY_MODE_SDK = 0; | |
public static final int OVERLAY_MODE_CLASSIC = 1; | |
@Inject MapInitializer mapInitializer; | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<attr format="enum" name="overlayMode"> | |
<enum name="sdk" value="0"/> | |
<enum name="classic" value="1"/> | |
</attr> | |
<declare-styleable name="MapView"> | |
<attr name="overlayMode" /> | |
</declare-styleable> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AccountStoreTest { | |
private AccountStore accountStore = new TestAccountStore(new Activity()); | |
@Test public void shouldNotBeNull() throws Exception { | |
assertThat(accountStore).isNotNull(); | |
} | |
@Test | |
public void shouldStoreCredentials() throws Exception { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AccountStore { | |
private static final String USERNAME = "username"; | |
private static final String PASSWORD = "password"; | |
private final Context context; | |
public AccountStore(Context context) { | |
this.context = context; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java.lang.NullPointerException | |
at com.example.ecgreb.mvpc.model.AccountStore.storeCredentials(AccountStore.java:21) | |
at com.example.ecgreb.mvpc.model.AccountStoreTest.shouldStoreCredentials(AccountStoreTest.java:21) | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | |
at java.lang.reflect.Method.invoke(Method.java:498) | |
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) | |
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) | |
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AccountStoreTest { | |
private AccountStore accountStore = new AccountStore(new Activity()); | |
@Test public void shouldNotBeNull() throws Exception { | |
assertThat(accountStore).isNotNull(); | |
} | |
@Test | |
public void shouldStoreCredentials() throws Exception { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AccountStore { | |
private static final String USERNAME = "username"; | |
private static final String PASSWORD = "password"; | |
private final Context context; | |
public AccountStore(Context context) { | |
this.context = context; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test public void setRequest_shouldRegisterGpsAndNetworkIfPriorityHighAccuracy() | |
throws Exception { | |
FusionEngine fusionEngine = | |
new FusionEngine(application, new TestCallback()); | |
fusionEngine.setRequest(LocationRequest.create() | |
.setPriority(PRIORITY_HIGH_ACCURACY)); | |
Collection<String> providers = shadowLocationManager | |
.getProvidersForListener(fusionEngine); |