mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-27 09:54:51 +01:00
return summed fees and amounts for self payments
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package de.cotto.lndmanagej.dto;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static de.cotto.lndmanagej.model.SelfPaymentFixtures.SELF_PAYMENT;
|
||||
import static de.cotto.lndmanagej.model.SelfPaymentFixtures.SELF_PAYMENT_2;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class SelfPaymentsDtoTest {
|
||||
@Test
|
||||
void no_self_payments() {
|
||||
SelfPaymentsDto empty = new SelfPaymentsDto(List.of());
|
||||
assertThat(empty.selfPayments()).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void amountPaid() {
|
||||
SelfPaymentsDto empty = new SelfPaymentsDto(List.of(SELF_PAYMENT, SELF_PAYMENT_2));
|
||||
String expected = String.valueOf(SELF_PAYMENT.amountPaid().add(SELF_PAYMENT_2.amountPaid()).milliSatoshis());
|
||||
assertThat(empty.amountPaid()).isEqualTo(expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
void fees() {
|
||||
SelfPaymentsDto empty = new SelfPaymentsDto(List.of(SELF_PAYMENT, SELF_PAYMENT_2));
|
||||
String expected = String.valueOf(SELF_PAYMENT.fees().add(SELF_PAYMENT_2.fees()).milliSatoshis());
|
||||
assertThat(empty.fees()).isEqualTo(expected);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user