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 KListPopupWindow(itemTypeBuilder: KAdapterItemTypeBuilder.() -> Unit) | |
: ListActions, BaseAssertions { | |
private val builder = ViewBuilder().apply({ withClassName(StringContains(ListView::class.simpleName)) }) | |
val matcher = this.builder.getViewMatcher() | |
val itemTypes = KAdapterItemTypeBuilder().apply(itemTypeBuilder).itemTypes | |
override val view = this.builder.getViewInteraction().inRoot(RootMatchers.isPlatformPopup()) | |
/** |
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 KToast : BaseActions, TextViewAssertions { | |
private val builder = ViewBuilder().apply( {withAnyText()} ) | |
val matcher = this.builder.getViewMatcher() | |
override val view = this.builder.getViewInteraction().inRoot(ToastMatcher()) | |
/** | |
* Operator that allows usage of DSL style | |
* | |
* @param function Tail lambda with receiver which is your view |
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
data class Tree<T>(var value: T) { | |
var left: Tree<T>? = null | |
var right: Tree<T>? = null | |
} | |
fun constructSumTree(tree: Tree<Int>?): Tree<Int>? { | |
if(tree == null) return null | |
reduceLeafs(tree) | |
return tree |