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
class MainActivity : AppCompatActivity(), ServiceLocatorActivity { | |
override val self: Activity = this | |
private val mainViewModelFactory: MainViewModelFactory by lazy { | |
serviceLocator.mainViewModelFactory | |
} | |
private val viewModel: MainViewModel by viewModels { | |
mainViewModelFactory |
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 | |
fun verificarClicBotonCero() { | |
val valorEsperado = Numeros.CERO.valor | |
btnCero.perform(ViewActions.click()) | |
tvVisualizadorOperacion.check(ViewAssertions.matches(ViewMatchers.withText(valorEsperado))) | |
} |
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
internal class MainActivityTest{ | |
@get:Rule | |
var activityTestRule = ActivityTestRule(MainActivity::class.java) | |
// Numeros | |
private val btnCero = onView(ViewMatchers.withId((R.id.btnCero))) | |
private val btnUno = onView(ViewMatchers.withId((R.id.btnUno))) | |
private val btnDos = onView(ViewMatchers.withId((R.id.btnDos))) |
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
internal class MainActivityTest{ | |
@get:Rule | |
var activityTestRule = ActivityTestRule(MainActivity::class.java) | |
// Numeros | |
private val btnCero = onView(ViewMatchers.withId((R.id.btnCero))) | |
private val btnUno = onView(ViewMatchers.withId((R.id.btnUno))) | |
private val btnDos = onView(ViewMatchers.withId((R.id.btnDos))) |
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
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".ui.MainActivity"> | |
<TextView | |
android:id="@+id/tvVisualizadorOperacion" |
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 androidx.test.espresso.Espresso.onView | |
import androidx.test.espresso.matcher.ViewMatchers | |
import androidx.test.rule.ActivityTestRule | |
import org.junit.Rule | |
import org.junit.jupiter.api.Assertions.* | |
import org.junit.rules.TestName | |
internal class MainActivityTest{ | |
@get:Rule |
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 androidx.test.rule.ActivityTestRule | |
import org.junit.Rule | |
import org.junit.jupiter.api.Assertions.* | |
import org.junit.rules.TestName | |
internal class MainActivityTest{ | |
@get:Rule | |
var activityTestRule = ActivityTestRule(MainActivity::class.java) |
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
class MainActivity : AppCompatActivity(), ServiceLocatorActivity { | |
override val self: Activity = this | |
private val mainViewModelFactory: MainViewModelFactory by lazy { | |
serviceLocator.mainViewModelFactory | |
} | |
private val viewModel: MainViewModel by viewModels { | |
mainViewModelFactory |
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
class AppServiceLocator : ServiceLocator { | |
private val calculadorUseCase: CalculadorUseCase by lazy { | |
CalculadorUseCaseImpl() | |
} | |
private val evaluadorUseCase: EvaluadorUseCase by lazy { | |
EvaluadorUseCaseImpl(validadorUseCase, evaluadorExpresionUseCase) | |
} | |
private val evaluadorExpresionUseCase: EvaluadorExpresionUseCase by lazy { | |
EvaluadorExpresionUseCaseImpl(calculadorUseCase) | |
} |
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
class MainActivity : AppCompatActivity() { | |
private val mainViewModelFactory: MainViewModelFactory by lazy { | |
MainViewModelFactory(DEPENDENCIA_DE_EVALUADOR_USECASE) | |
} | |
private val viewModel: MainViewModel by viewModels { | |
mainViewModelFactory | |
} |
NewerOlder