-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Miscellaneous coverage improvements.
- Loading branch information
Showing
5 changed files
with
70 additions
and
41 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
31 changes: 31 additions & 0 deletions
31
formula/src/test/java/com/instacart/formula/DeferredActionTest.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.instacart.formula | ||
|
||
import com.google.common.truth.Truth.assertThat | ||
import org.junit.Test | ||
|
||
class DeferredActionTest { | ||
|
||
@Test | ||
fun `identity equality returns true`() { | ||
val callback = { _: Unit -> } | ||
val action = DeferredAction(key = "1", action = Action.onInit(), callback) | ||
assertThat(action.equals(action)).isTrue() | ||
} | ||
|
||
@Test | ||
fun `when class is different, equality returns false`() { | ||
val callback = { _: Unit -> } | ||
val action = DeferredAction(key = "1", action = Action.onInit(), callback) | ||
assertThat(action).isNotEqualTo("string") | ||
} | ||
|
||
@Test | ||
fun `when listeners are not equal, the actions are not equal`() { | ||
val callback = { _: Unit -> } | ||
val callback2 = { _: Unit -> } | ||
val action1 = DeferredAction(key = "1", action = Action.onInit(), callback) | ||
val action2 = DeferredAction(key = "1", action = Action.onInit(), callback2) | ||
|
||
assertThat(action1).isNotEqualTo(action2) | ||
} | ||
} |
This file contains 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