Skip to content

Commit

Permalink
#31 removing dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
mjureczko committed Jul 5, 2024
1 parent 6be9fd8 commit fd79989
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@ class SearchingActivityViewModel(private val state: SavedStateHandle) : ViewMode
fun treasureSelectionInitialized() =
treasureSelectionInitialized || treasuresProgress.selectedTreasure != null

fun collectTreasure(treasure: Treasure, storageHelper: StorageHelper) {
treasuresProgress.collect(treasure)
storageHelper.save(this.treasuresProgress)
}

fun getGolds(): String =
treasuresProgress.golds.toString()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@ import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.mockito.BDDMockito.given
import org.mockito.BDDMockito.reset
import org.mockito.BDDMockito.then
import org.mockito.Mock
import org.mockito.Mockito
import org.mockito.junit.jupiter.MockitoExtension
import pl.marianjureczko.poszukiwacz.model.Route
import pl.marianjureczko.poszukiwacz.model.Treasure
import pl.marianjureczko.poszukiwacz.model.TreasureType
import pl.marianjureczko.poszukiwacz.model.TreasuresProgress
import pl.marianjureczko.poszukiwacz.shared.StorageHelper
import pl.marianjureczko.poszukiwacz.shared.XmlHelper
Expand Down Expand Up @@ -68,22 +65,6 @@ class SearchingActivityViewModelTest {
assertThat(model.getProgress()).usingRecursiveComparison().isEqualTo(treasuresProgress)
}

@Test
fun `SHOULD save new treasure progress WHEN collecting next treasure`() {
//given
val fixture = SearchingActivityViewModelFixture(state)
fixture.setupMockForEmptyTreasureBag(storageHelper)
val treasure = some<Treasure>().copy(type = TreasureType.DIAMOND)
reset(storageHelper)

//when
fixture.model.collectTreasure(treasure, storageHelper)

//then
then(storageHelper).should().save(fixture.model.getProgress())
assertThat(fixture.model.getDiamonds()).isEqualTo(treasure.quantity.toString())
}

@Test
fun `SHOULD say initialized WHEN the flag was set by calling getTreasureSelectorActivityInputData`() {
//given
Expand Down

0 comments on commit fd79989

Please sign in to comment.