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
func Test$NAME$(t *testing.T) { | |
cases := map[string]struct { | |
input string | |
expected string | |
}{ | |
"TestName Test1": { | |
input: "foo", | |
expected: "bar", | |
}, | |
} |
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
RecyclerViewInteraction.<Item>onRecyclerView(withId(R.id.recyclerview), 1) | |
.withItems(items) | |
.check(new ItemViewAssertion<Item>() { | |
@Override | |
public void check(Item item, View view, NoMatchingViewException e) { | |
matches(hasDescendant(withText(item.getDisplayName()))) | |
.check(view, e); | |
} | |
}); |
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 Item { | |
String displayName; | |
public Item(String displayName) { | |
this.displayName = displayName; | |
} | |
public String getDisplayName() { | |
return displayName; | |
} |
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 static class MyViewAction { | |
public static ViewAction clickChildViewWithId(final int id) { | |
return new ViewAction() { | |
@Override | |
public Matcher<View> getConstraints() { | |
return null; | |
} | |
@Override |
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
dependencies { | |
compile fileTree(dir: 'libs', include: ['*.jar']) | |
androidTestCompile 'org.hamcrest:hamcrest-library:1.3' | |
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2' | |
androidTestCompile 'com.android.support:support-annotations:23.3.0' | |
androidTestCompile 'com.android.support.test:runner:0.5' | |
androidTestCompile 'com.android.support.test:rules:0.5' | |
androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2'){ | |
exclude group: 'com.android.support', module: 'support-v4' | |
exclude group: 'com.android.support', module: 'recyclerview-v7' |
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
^!h:: ; Ctrl + Alt + h | |
Send ^c ; テキストをクリップボードにコピー | |
Run "C:\HogeEditor.exe" | |
Sleep 100 | |
Clip0 = %ClipBoardAll% | |
ClipBoard = %ClipBoard% ; Convert to text | |
Send ^v ; For best compatibility: SendPlay | |
Sleep 50 ; Don't change clipboard while it is pasted! (Sleep > 0) | |
ClipBoard = %Clip0% ; Restore original ClipBoard | |
VarSetCapacity(Clip0, 0) ; Free memory |
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
import android.test.ActivityInstrumentationTestCase2; | |
import android.util.Log; | |
import java.io.BufferedReader; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import static org.hamcrest.CoreMatchers.is; | |
import static org.hamcrest.CoreMatchers.notNullValue; | |
import static org.hamcrest.MatcherAssert.assertThat; |
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
/** | |
* 型の異なるListの中身を検証しやすくするクラス | |
* | |
* Listを検証するにあたり、Listのサイズの検証、Listのどの位置でAssertionErrorが発生したかを | |
* このクラスで共通化し、abstractメソッドのverifyでListの中身の検証等を呼び出し元で行うもの | |
* | |
* [参考] | |
* http://dev.classmethod.jp/testing/unittesting/custom-assertion-using-junit/ | |
* https://github.com/classmethod/cmtest/blob/master/cmtest-core/src/main/java/jp/classmethod/testing/verifier/ArrayVerifier.java | |
* Created by takaiwa.net on 2015/12/16. |
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
final static String TAG = "hoge"; | |
final static String base64EncodedPublicKey = ""; | |
final static String PRODUCT_ID = "foo"; | |
IabHelper mHelper; | |
/** | |
* テスト用 | |
* 購入したものを消費する | |
* | |
* @param act |
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 OnActivityResultTest extends InstrumentationTestCase { | |
public void test() throws Exception { | |
Instrumentation instrumentation = getInstrumentation(); | |
Instrumentation.ActivityMonitor monitor = instrumentation.addMonitor( | |
TestTargetActivity.class.getName(), null, false); | |
// onActivityResultテスト対象のTestTargetActivityを起動 | |
Intent intent = new Intent(Intent.ACTION_MAIN); | |
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
NewerOlder