-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrated BleDisconnectedExceptionTest.
- Loading branch information
1 parent
0fe048a
commit 73179f2
Showing
2 changed files
with
28 additions
and
33 deletions.
There are no files selected for viewing
33 changes: 0 additions & 33 deletions
33
.../src/test/groovy/com/polidea/rxandroidble2/exceptions/BleDisconnectedExceptionTest.groovy
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
...dble/src/test/java/com/polidea/rxandroidble2/exceptions/BleDisconnectedExceptionTest.java
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,28 @@ | ||
package com.polidea.rxandroidble2.exceptions; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class BleDisconnectedExceptionTest { | ||
|
||
@SuppressWarnings("deprecation") | ||
@Test | ||
public void toStringShouldContainMessageWithUnknownStatus() { | ||
// given | ||
BleDisconnectedException out = new BleDisconnectedException("myBluetoothAddress"); | ||
|
||
// expect | ||
assertEquals(out.toString(), "com.polidea.rxandroidble2.exceptions.BleDisconnectedException: Disconnected from MAC='XX:XX:XX:XX:XX:XX' with status -1 (UNKNOWN)"); | ||
} | ||
|
||
@Test | ||
public void toStringShouldContainMessageWithStatus() { | ||
// given | ||
int expectedStatus = 129; // 0x81 | ||
BleDisconnectedException out = new BleDisconnectedException("myBluetoothAddress", expectedStatus); | ||
|
||
// expect | ||
assertEquals(out.toString(), "com.polidea.rxandroidble2.exceptions.BleDisconnectedException: Disconnected from MAC='XX:XX:XX:XX:XX:XX' with status 129 (GATT_INTERNAL_ERROR)"); | ||
} | ||
} |