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
"click": [ | |
{ | |
"onOptionsItemSelected": { | |
"itemId": "android:id\/home", | |
"title": "Location" | |
} | |
}, | |
{ | |
"supportFinishAfterTransition": {} | |
} |
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
"click": [ | |
{ | |
"Fragments changed": { | |
"Fragment name": "ManageRoomPhotosFragment", | |
"args": "ManageRoomPhotosArgs(id=100, name=\"Kitchen\")", | |
"state": "STOPPED" | |
} | |
} | |
] |
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
"click": [ | |
{ | |
"Request Executed": { | |
"GET": "https://api.airbnb.com/v2/trip_host_reviews?_format=for_funston&_limit=5&_offset=0&host_id=1&rating=5" | |
} | |
} |
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
"click": [ | |
{ | |
"MvRx State set": { | |
"CancellationPolicyState": { | |
"selectedPolicyKey": { | |
"newValue": "flexible", | |
"oldValue": "strict_14_with_grace_period" | |
} | |
} | |
} |
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
"State set": { | |
"RoomCountsState": { | |
"modifiedRoomCounts": { | |
"added keys": "[Bedroom=2]" | |
} | |
} | |
} |
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
data class TextState(val text: String? = null) : MvRxState | |
class TextViewModel(state: TextState) : MvRxViewModel<TextState>(state) { | |
fun setText(text: String) { | |
setState { | |
copy(text = text) | |
} | |
} | |
} |
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 setText() = TextViewModel::setText { | |
withParams("hello") expectState { | |
copy(text = "hello") | |
} | |
} |
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 TextViewModelTest : ViewModelTest<TextState, TextViewModel> { | |
override fun buildViewModel() = TextViewModel(TextState()) | |
@Test | |
fun setText() = TextViewModel::setText { | |
withParams("hello") expectState { | |
copy(text = "hello") | |
} | |
} |
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
data class TextOptions(val bold: Boolean = false) | |
data class TextState(val text: String? = null, val options: TextOptions = TextOptions()) : MvRxState | |
class TextViewModel(state: TextState) : MvRxViewModel<TextState>(state) { | |
fun setText(text: String) { | |
setState { | |
copy(text = text) | |
} |
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 setBold() = TextViewModel::setBold { | |
initialState { | |
setFalse { ::options { ::bold } } | |
} | |
withParams(true) expectState { | |
setTrue { ::options { ::bold } } | |
} | |
} |