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 Api @Inject constructor() |
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 MyPresenter @Inject constructor(val api: Api) |
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 MyActivity : Activity { | |
@Inject | |
lateinit var presenter: MyPresenter | |
} |
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 MyActivity : Activity { | |
val presenter: MyPresenter = MyPresenterImpl() | |
} | |
class MyPresenterImpl : MyPresenter | |
interface MyPresenter |
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 MyActivity : Activity { | |
val presenter: MyPresenterImpl = MyPresenterImpl() | |
} | |
class MyPresenterImpl |
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 MyPresenter(val api: Api, val view: MyView) { | |
fun onSubmitClick() { | |
api.submit().subscribe( | |
onNext = { data -> view.showSuccess(data) }, | |
onError = { throwable -> view.showErrorDialog(throwable) } | |
) | |
} | |
} | |
fun testMyPresenterOnSubmitFail() { |
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 Car(val engine: Engine) { | |
fun start() { | |
engine.start() | |
} | |
} |
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 { | |
implementation 'com.google.code.gson:gson:2.8.5' | |
} |
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 Car { | |
val engine = Engine() | |
fun start() { | |
engine.start() | |
} | |
} | |
class Engine { | |
fun start() = //... | |
} |
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 MainPage(driver: AppiumDriver<WebElement>) { | |
init { | |
PageFactory.initElements(AppiumFieldDecorator(driver), this) | |
} | |
@AndroidFindBy(id = "com.blacklenspub.helloappium:id/tvLabel") | |
@iOSFindBy(xpath = "//XCUIElementTypeStaticText[1]") | |
lateinit var myLabel: WebElement | |
@AndroidFindBy(id = "com.blacklenspub.helloappium:id/btnGreet") |
NewerOlder