This file contains hidden or 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 storeSingleWallet() { | |
Wallet bankWallet = Wallet.create(randomUUID(), "bank"); | |
storage.insert(bankWallet); | |
assertThat(getStoredWalletNames()) | |
.containsExactly("bank"); | |
} | |
private List<String> getStoredWalletNames() { |
This file contains hidden or 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 interface WalletsStorage { | |
/** | |
* List all stored {@link Wallet}s. Result is null safe | |
* | |
* @return Collection of all stored Wallets or Collections.emptyList() for empty result. | |
*/ | |
Collection<Wallet> list(); | |
/** | |
* Stores {@link Wallet} object. |
This file contains hidden or 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
package pl.expensive.db; | |
import android.database.Cursor; | |
import android.database.sqlite.SQLiteDatabase; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class DatabaseSchemaTestHelper { |
This file contains hidden or 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
testOptions.unitTests.all { | |
testLogging { | |
events 'passed', 'skipped', 'failed', 'standardOut', 'standardError' | |
exceptionFormat 'full' | |
} | |
} |
This file contains hidden or 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
package pl.izmajlowiczl.bsj.delete_me; | |
import android.text.format.DateUtils; | |
import org.junit.Before; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.robolectric.RobolectricTestRunner; | |
import java.util.Calendar; |
This file contains hidden or 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
#!/bin/sh | |
# Command to set date for running device: | |
# adb shell date -s yyyymmdd.hhmmss | |
now="$(date +'%Y%m%d')" | |
adb shell date -s $now.$1$2 |
This file contains hidden or 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
import android.content.SharedPreferences; | |
import org.junit.Before; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.robolectric.Robolectric; | |
import org.robolectric.RobolectricTestRunner; | |
import static org.junit.Assert.assertEquals; | |
@RunWith(RobolectricTestRunner.class) | |
public class TheLastSyncTimestamp { |
This file contains hidden or 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 homeButtonHidesKeyboard() { | |
final MenuItem item = mock(MenuItem.class); | |
when(item.getItemId()).thenReturn(android.R.id.home); | |
testedFragment.onOptionsItemSelected(item); | |
verify(keyboardHackerMock).hideKeyboardAndResetBottomPaddingFor(any(View.class)); | |
} |
This file contains hidden or 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
import android.app.Fragment; | |
import android.app.FragmentManager; | |
import android.app.FragmentTransaction; | |
import org.junit.runners.model.InitializationError; | |
import org.robolectric.RobolectricTestRunner; | |
/** | |
* Customized test runner based on {@link org.robolectric.RobolectricTestRunner}. | |
* | |
* Creator: <[email protected]> |
This file contains hidden or 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
package com.mydriver.customer.ui.common.custom; | |
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.view.MotionEvent; | |
import android.view.View; | |
import android.view.ViewParent; | |
import android.widget.DatePicker; | |
/** |