Skip to content

Commit

Permalink
Migrated BleDisconnectedExceptionTest.
Browse files Browse the repository at this point in the history
  • Loading branch information
dariuszseweryn committed Mar 17, 2024
1 parent 0fe048a commit 73179f2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 33 deletions.

This file was deleted.

@@ -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)");
}
}

0 comments on commit 73179f2

Please sign in to comment.