add "is active" to channel details

This commit is contained in:
Carsten Otto
2021-11-23 22:41:01 +01:00
parent 073d0b3d17
commit 1af968ee25
11 changed files with 90 additions and 19 deletions

View File

@@ -8,6 +8,7 @@ import static de.cotto.lndmanagej.model.ChannelFixtures.CAPACITY;
import static de.cotto.lndmanagej.model.ChannelIdFixtures.CHANNEL_ID;
import static de.cotto.lndmanagej.model.ChannelPointFixtures.CHANNEL_POINT;
import static de.cotto.lndmanagej.model.CoopClosedChannelFixtures.CLOSED_CHANNEL;
import static de.cotto.lndmanagej.model.LocalOpenChannelFixtures.LOCAL_OPEN_CHANNEL;
import static de.cotto.lndmanagej.model.LocalOpenChannelFixtures.LOCAL_OPEN_CHANNEL_PRIVATE;
import static de.cotto.lndmanagej.model.NodeFixtures.ALIAS;
import static de.cotto.lndmanagej.model.PubkeyFixtures.PUBKEY_2;
@@ -71,6 +72,18 @@ class ChannelDetailsDtoTest {
assertThat(dto.privateChannel()).isTrue();
}
@Test
void active_true() {
ChannelDetailsDto dto =
new ChannelDetailsDto(LOCAL_OPEN_CHANNEL, ALIAS, BALANCE_INFORMATION, ON_CHAIN_COSTS);
assertThat(dto.active()).isTrue();
}
@Test
void active_false() {
assertThat(CHANNEL_DETAILS_DTO.active()).isFalse();
}
@Test
void balance() {
assertThat(CHANNEL_DETAILS_DTO.balance()).isEqualTo(BalanceInformationDto.createFrom(BALANCE_INFORMATION));