assertEquals
Asserts that a Tile returns the expected value.
Parameters
The tile to test
The expected value
Type Parameters
The type of value the tile returns
Throws
if the actual value doesn't match the expected value
testMosaic.assertEquals(MyTile, "expected value")Asserts that a Tile returns the expected value with a custom failure message.
Parameters
The tile to test
The expected value
The message to include in case of assertion failure
Type Parameters
The type of value the tile returns
Throws
if the actual value doesn't match the expected value
testMosaic.assertEquals(
tile = MyTile,
expected = "expected value",
message = "The tile did not return the expected value"
)Asserts that a MultiTile returns the expected values for the given keys.
Parameters
The tile to test
The list of keys to request from the tile
The expected map of keys to values
Type Parameters
The type of keys in the response map
The type of values in the response map
Throws
if the actual values don't match the expected values
testMosaic.assertEquals(
tile = UserTile,
keys = listOf("user1", "user2"),
expected = mapOf("user1" to User("user1"), "user2" to User("user2"))
)Asserts that a MultiTile returns the expected values for the given keys with a custom failure message.
Parameters
The tile to test
The list of keys to request from the tile
The expected map of keys to values
The message to include in case of assertion failure
Type Parameters
The type of keys in the response map
The type of values in the response map
Throws
if the actual values don't match the expected values
testMosaic.assertEquals(
tile = UserTile,
keys = listOf("user1", "user2"),
expected = mapOf("user1" to User("user1"), "user2" to User("user2")),
message = "User data does not match expected values"
)