mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-27 01:44:30 +01:00
add tests
This commit is contained in:
@@ -12,6 +12,10 @@ import static de.cotto.lndmanagej.model.PubkeyFixtures.PUBKEY_2;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class MissionControlEntryTest {
|
||||
|
||||
private static final MissionControlEntry ENTRY =
|
||||
new MissionControlEntry(PUBKEY, PUBKEY_2, Coins.ofSatoshis(123), Instant.ofEpochSecond(100), false);
|
||||
|
||||
@Test
|
||||
void success() {
|
||||
assertThat(SUCCESS.success()).isTrue();
|
||||
@@ -24,6 +28,21 @@ class MissionControlEntryTest {
|
||||
assertThat(FAILURE.failure()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void isAfter_same_value() {
|
||||
assertThat(ENTRY.isAfter(Instant.ofEpochSecond(100))).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void isAfter_strictly_after() {
|
||||
assertThat(ENTRY.isAfter(Instant.ofEpochSecond(99))).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void isAfter_strictly_before() {
|
||||
assertThat(ENTRY.isAfter(Instant.ofEpochSecond(101))).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void time() {
|
||||
assertThat(SUCCESS.time()).isBetween(Instant.now().minus(Duration.ofSeconds(10)), Instant.now());
|
||||
@@ -43,4 +62,4 @@ class MissionControlEntryTest {
|
||||
void target() {
|
||||
assertThat(SUCCESS.target()).isEqualTo(PUBKEY_2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user