Skip to content

Instantly share code, notes, and snippets.

@CesarValiente
Last active February 9, 2019 09:36
Show Gist options
  • Save CesarValiente/7dc2c9bb3527ad96d9e912fdc803124a to your computer and use it in GitHub Desktop.
Save CesarValiente/7dc2c9bb3527ad96d9e912fdc803124a to your computer and use it in GitHub Desktop.
@Test
fun should_reduceItemsCollection_when_CreateItemAction_and_empty_collection() {
val createItemAction = CreateItemAction(
localId = LOCAL_ID,
text = TEXT,
favorite = FAVORITE,
color = COLOR,
position = POSITION)
val itemsReduced = CreationReducer.reduceItemsCollection(
action = createItemAction,
currentItems = emptyList())
assertThat(itemsReduced, iz(not(emptyList())))
assertThat(itemsReduced.count(), iz(1))
assertThat(itemsReduced, iz(listOf(
Item(localId = LOCAL_ID,
text = TEXT, favorite = FAVORITE, color = COLOR,
position = POSITION))))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment