Issue#13 Fix typos
This commit is contained in:
parent
c952f4f34d
commit
070f282103
1 changed files with 5 additions and 5 deletions
|
|
@ -487,7 +487,7 @@ fun tearDown() {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Networking syncronization and mocking
|
##### Networking synchronization and mocking
|
||||||
We have a helper method for that, but the basic idea is that, we use our MockWebSetup and synchronize with Espresso using idling resources.
|
We have a helper method for that, but the basic idea is that, we use our MockWebSetup and synchronize with Espresso using idling resources.
|
||||||
```kotlin
|
```kotlin
|
||||||
@Before
|
@Before
|
||||||
|
|
@ -514,7 +514,7 @@ fun tearDown() {
|
||||||
Idling Resources makes sure that Espresso awaits the Idling Resource before touching the UI components. Disposable is just a way to remove them from Espresso when we no longer need it.
|
Idling Resources makes sure that Espresso awaits the Idling Resource before touching the UI components. Disposable is just a way to remove them from Espresso when we no longer need it.
|
||||||
|
|
||||||
##### Coroutine Test Setup
|
##### Coroutine Test Setup
|
||||||
We use a TestDispatcher and initialze our database with it as well.
|
We use a TestDispatcher and initialize our database with it as well.
|
||||||
|
|
||||||
```kotlin
|
```kotlin
|
||||||
@Before
|
@Before
|
||||||
|
|
@ -572,7 +572,7 @@ mockServerScenarioSetup.setScenario(
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
Next via the Robot we input the data and click on the signin:
|
Next via the Robot we input the data and click on the sign in:
|
||||||
```kotlin
|
```kotlin
|
||||||
robot.setPassword("alma")
|
robot.setPassword("alma")
|
||||||
.setUsername("banan")
|
.setUsername("banan")
|
||||||
|
|
@ -627,7 +627,7 @@ robot.assertErrorIsShown(R.string.username_is_invalid)
|
||||||
|
|
||||||
### 4. `invalidCredentialsGivenShowsProperErrorMessage`
|
### 4. `invalidCredentialsGivenShowsProperErrorMessage`
|
||||||
|
|
||||||
Now we verify network erros. First let's setup the response:
|
Now we verify network errors. First let's setup the response:
|
||||||
```kotlin
|
```kotlin
|
||||||
mockServerScenarioSetup.setScenario(
|
mockServerScenarioSetup.setScenario(
|
||||||
AuthScenario.InvalidCredentials(username = "alma", password = "banan"),
|
AuthScenario.InvalidCredentials(username = "alma", password = "banan"),
|
||||||
|
|
@ -682,7 +682,7 @@ robot.assertErrorIsShown(R.string.something_went_wrong)
|
||||||
|
|
||||||
## Conclusion
|
## Conclusion
|
||||||
|
|
||||||
With that we finished our Robolectric tests, setup might be a bit tidious but we can use TestRules to make the setup reusable. In fact we will do that in the next session.
|
With that we finished our Robolectric tests, setup might be a bit tedious but we can use TestRules to make the setup reusable. In fact we will do that in the next session.
|
||||||
|
|
||||||
What we have learned:
|
What we have learned:
|
||||||
- How to use Robolectric to verify context dependent classes
|
- How to use Robolectric to verify context dependent classes
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue