Commit 17209ed1 by aquilescanta Committed by Oliver Woodman

Use the term equivalent instead of equal in assertion

The assertion doesn't check equality (as in x.equals(y)), but rather
whether a subset of the fields are equal.

PiperOrigin-RevId: 374183338
parent 2566b246
......@@ -36,7 +36,7 @@ public class PlaybackExceptionTest {
/* cause= */ new IOException(/* message= */ "io"),
PlaybackException.ERROR_CODE_IO_FILE_NOT_FOUND);
PlaybackException after = PlaybackException.CREATOR.fromBundle(before.toBundle());
assertPlaybackExceptionsAreEqual(before, after);
assertPlaybackExceptionsAreEquivalent(before, after);
}
// Backward compatibility tests.
......@@ -60,7 +60,7 @@ public class PlaybackExceptionTest {
bundle.putString("3", expectedCause.getClass().getName());
bundle.putString("4", "cause message");
assertPlaybackExceptionsAreEqual(
assertPlaybackExceptionsAreEquivalent(
expectedException, PlaybackException.CREATOR.fromBundle(bundle));
}
......@@ -99,13 +99,14 @@ public class PlaybackExceptionTest {
bundle.putString("3", "invalid cause class name");
bundle.putString("4", "cause message");
assertPlaybackExceptionsAreEqual(
assertPlaybackExceptionsAreEquivalent(
expectedException, PlaybackException.CREATOR.fromBundle(bundle));
}
// Internal methods.
private static void assertPlaybackExceptionsAreEqual(PlaybackException a, PlaybackException b) {
private static void assertPlaybackExceptionsAreEquivalent(
PlaybackException a, PlaybackException b) {
assertThat(a).hasMessageThat().isEqualTo(b.getMessage());
assertThat(a.errorCode).isEqualTo(b.errorCode);
assertThat(a.timestampMs).isEqualTo(b.timestampMs);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment