This commit is contained in:
parent
22ffb02971
commit
fdfdb12cd5
1 changed files with 0 additions and 64 deletions
|
|
@ -1,64 +0,0 @@
|
||||||
package ru.spcex.clearing.reports.services;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.Instant;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
||||||
|
|
||||||
class AbstractReportCollectorTest extends AbstractReportCollector {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void testToString() {
|
|
||||||
AbstractReportCollectorTest instance = new AbstractReportCollectorTest();
|
|
||||||
assertEquals("", instance.toString((Long) null));
|
|
||||||
assertEquals("1", instance.toString((Long) 1L));
|
|
||||||
assertEquals("1230", instance.toString((Long) 1230L));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void testToString1() {
|
|
||||||
AbstractReportCollectorTest instance = new AbstractReportCollectorTest();
|
|
||||||
assertEquals("", instance.toString((Instant) null));
|
|
||||||
Instant val = Instant.ofEpochMilli(1672058774338L);
|
|
||||||
assertEquals("26.12.2022T15:46:14", instance.toString(val)); // msk timezone
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void testToString2() {
|
|
||||||
AbstractReportCollectorTest instance = new AbstractReportCollectorTest();
|
|
||||||
LocalDate val = LocalDate.of(2022, 12, 26);
|
|
||||||
assertEquals("26.12.2022", instance.toString(val));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void testToString3() {
|
|
||||||
AbstractReportCollectorTest instance = new AbstractReportCollectorTest();
|
|
||||||
assertEquals("", instance.toString((BigDecimal)null));
|
|
||||||
assertEquals("0.00", instance.toString(BigDecimal.ZERO));
|
|
||||||
assertEquals("1.10", instance.toString(BigDecimal.valueOf(1.10)));
|
|
||||||
assertEquals("100.12", instance.toString(BigDecimal.valueOf(100.12)));
|
|
||||||
assertEquals("100.12", instance.toString(BigDecimal.valueOf(100.120012)));
|
|
||||||
assertEquals("100.13", instance.toString(BigDecimal.valueOf(100.125012)));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void testToString4() {
|
|
||||||
AbstractReportCollectorTest instance = new AbstractReportCollectorTest();
|
|
||||||
assertEquals("", instance.toString((Double) null));
|
|
||||||
assertEquals("0.00", instance.toString(0.0));
|
|
||||||
assertEquals("1.10", instance.toString(1.10));
|
|
||||||
assertEquals("100.12", instance.toString(100.12));
|
|
||||||
assertEquals("100.12", instance.toString(100.120012));
|
|
||||||
assertEquals("100.13", instance.toString(100.125012));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Class<AbstractReport> getReportClass() {
|
|
||||||
return AbstractReport.class;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Reference in a new issue