[go: nahoru, domu]

Skip to content

Commit

Permalink
Add object equality tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kolotaev committed Feb 18, 2018
1 parent 72c001a commit d143a4c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/test/scala/com/github/kolotaev/ride/IdSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,17 @@ class IdSpec extends FlatSpec with Matchers {
b should equal (a)
}

"IDs" should "not be equal as objects if they represent different values" in {
val a = Id()
val b = Id()
b shouldNot equal(a)
}

"ID" should "not be equal as objects with the string representation of itself" in {
val a = Id()
a shouldNot equal(a.toString)
}

"IDs" should "be converted to itself back and forth and be equal as strings" in {
val a = Id()
val b = new Id(a.toString)
Expand Down

0 comments on commit d143a4c

Please sign in to comment.