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
package com.alviere.onetwotrip; | |
import java.io.*; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.Scanner; | |
public class Main { | |
private static final int NEEDED_STRING_SIZE = 10; |
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 espressoTest() { | |
onView(allOf(allOf(withId(R.id.label_bf_hotelname), | |
isDescendantOfA(withId(R.id.custom_view_trip_review))), | |
isDescendantOfA(withId(R.id.contentView)))) | |
.check(matches(withEffectiveVisibility(View.VISIBLE))); | |
} |
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 | |
fun espressoTest() { | |
screen { hotelName { isVisible() } } | |
} |
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 KTextView : KBaseView<KTextView>, TextViewAssertions { | |
constructor(function: ViewBuilder.() -> Unit): super(function) | |
constructor(parent: Matcher<View>, function: ViewBuilder.() -> Unit): super(parent, function) | |
constructor(parent: DataInteraction, function: ViewBuilder.() -> Unit): super(parent, function) | |
} |
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
@RunWith(AndroidJUnit4::class) | |
class TestActivityTest { | |
@Rule | |
@JvmField | |
val rule = ActivityTestRule(TestActivity::class.java) | |
val screen = TestActivityScreen() | |
@Test | |
fun test() { |
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
open class TestActivityScreen: Screen<TestActivityScreen>() { | |
val content: KView = KView { withId(R.id.content) } | |
val map: KView = KView { withId(R.id.map) } | |
val button: KButton = KButton { withId(R.id.button) } | |
val textViewLarge: KTextView = KTextView { | |
withId(R.id.text_view_large) | |
} | |
val textViewSmall: KTextView = KTextView { |
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
@Override | |
public <T> Class<? extends T> mockClass(MockFeatures<T> features) { | |
DynamicType.Builder<T> builder = | |
byteBuddy.subclass(features.mockedType) | |
.name(nameFor(features.mockedType)) | |
.ignoreAlso(isGroovyMethod()) | |
.annotateType(features.stripAnnotations | |
? new Annotation[0] | |
: features.mockedType.getAnnotations()) | |
.implement(new ArrayList<Type>(features.interfaces)) |
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 MockMethodInterceptor implements Serializable { | |
... | |
public static class DispatcherDefaultingToRealMethod { | |
@SuppressWarnings("unused") | |
@RuntimeType | |
@BindingPriority(BindingPriority.DEFAULT * 2) | |
public static Object interceptSuperCallable(@This Object mock, |
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 OpenClassCompiledMock extends OpenClass implements MockAccess { | |
private MockMethodInterceptor mockitoInterceptor; | |
public OpenClassCompiledMock() { | |
super(null); | |
} | |
@Override | |
public MockMethodInterceptor getMockitoInterceptor() { | |
return mockitoInterceptor; |
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 final class TonikExceptions { | |
private TonikExceptions() { | |
} | |
public static void throwException(Throwable exception) { | |
throwException(exception, null); | |
} | |
@SuppressWarnings("unchecked") |
OlderNewer