I hereby claim:
- I am mohsenoid on github.
- I am mohsenoid (https://keybase.io/mohsenoid) on keybase.
- I have a public key ASCmbE-Oa-53fhh-NupPHcgx4L8kF5uq83h7yqc7Hi9-4Ao
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
// building PhoneNumber objects | |
val phoneHome = AddressBookProtos.Person.PhoneNumber.newBuilder() | |
.setNumber("+49123456") | |
.setType(AddressBookProtos.Person.PhoneType.HOME) | |
.build() | |
val phoneMobile = AddressBookProtos.Person.PhoneNumber.newBuilder() | |
.setNumber("+49654321") | |
.setType(AddressBookProtos.Person.PhoneType.MOBILE) | |
.build() |
syntax = "proto2"; | |
package tutorial; | |
option java_package = "com.mohsenoid.protobuftest"; | |
option java_outer_classname = "AddressBookProtos"; | |
message Person { | |
required string name = 1; | |
required int32 id = 2; |
package com.mirhoseini.marvel.activity; | |
/*...*/ | |
@RunWith(AndroidJUnit4.class) | |
public class MainActivityTest { | |
private static final String TEST_CHARACTER_NAME = "Test Name"; | |
private static final String TEST_CHARACTER_DESCRIPTION = "Test Description"; | |
private static final String TEST_CHARACTER_THUMBNAIL_PATH = "Test Thumbnail"; |
package com.mirhoseini.marvel; | |
/*...*/ | |
public class MarvelTestApplication extends MarvelApplicationImpl { | |
@Override | |
public ApplicationTestComponent createComponent() { | |
return DaggerApplicationTestComponent | |
.builder() |
package com.mirhoseini.marvel; | |
/*...*/ | |
public class MarvelTestRunner extends AndroidJUnitRunner { | |
@Override | |
public Application newApplication(ClassLoader classLoader, String className, Context context) | |
throws InstantiationException, IllegalAccessException, ClassNotFoundException { | |
// replace Application class with mock one |
package com.mirhoseini.marvel.activity; | |
/*...*/ | |
@RunWith(RobolectricTestRunner.class) | |
@Config(constants = BuildConfig.class, sdk = 21, shadows = {ShadowSnackbar.class}) | |
public class MainActivityRobolectricTest { | |
private final static String TEST_TEXT = "This is a test text."; | |
private MainActivity activity; |
package com.mirhoseini.marvel.character.search; | |
/*...*/ | |
import org.junit.Before; | |
import org.junit.Test; | |
import java.util.Collections; | |
import rx.Observable; |
@Override | |
public void doSearch(boolean isConnected, String query, long timestamp) { | |
if (null != view) { | |
view.showProgress(); | |
} | |
subscription = interactor.loadCharacter(query, Constants.PRIVATE_KEY, Constants.PUBLIC_KEY, timestamp) | |
// check if result code is OK | |
.map(charactersResponse -> { | |
if (Constants.CODE_OK == charactersResponse.getCode()) |
package com.mirhoseini.marvel.util; | |
import javax.inject.Inject; | |
import rx.Scheduler; | |
import rx.android.schedulers.AndroidSchedulers; | |
import rx.schedulers.Schedulers; | |
public class AppSchedulerProvider implements SchedulerProvider { | |
@Inject |