Skip to content

Commit

Permalink
Added tests for new update() method
Browse files Browse the repository at this point in the history
  • Loading branch information
grzesiek2010 committed May 5, 2021
1 parent 2414da4 commit 360cede
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,23 @@ abstract class ProjectsRepositoryTest {
assertThat(projectsRepository.get(""), `is`(projectX.copy(uuid = "")))
}

@Test
fun `update() should update project`() {
projectsRepository.add(projectX)
projectsRepository.add(projectY)
projectsRepository.add(projectZ)

val originalProjectX = projectsRepository.getAll()[0]
val updatedProjectX = originalProjectX.copy(name = "Project X2", "2", "#ff80ff")
projectsRepository.update(updatedProjectX)

val projects = projectsRepository.getAll()
assertThat(projects.size, `is`(3))
assertThat(projects[0], `is`(updatedProjectX))
assertThat(projects[1], `is`(projectY))
assertThat(projects[2], `is`(projectZ))
}

@Test
fun `delete() should delete project from storage for given uuid`() {
projectsRepository.add(projectX)
Expand Down

0 comments on commit 360cede

Please sign in to comment.