1 package unit.kernel.models.variables.voltage_provider;
3 import com.pholser.junit.quickcheck.Property;
4 import com.pholser.junit.quickcheck.runner.JUnitQuickcheck;
6 import org.jetbrains.annotations.Contract;
7 import org.junit.Assume;
9 import org.junit.rules.ExpectedException;
10 import org.junit.runner.RunWith;
12 import java.time.Duration;
14 import static org.junit.Assert.assertEquals;
15 import static org.junit.Assert.fail;
20 @RunWith(JUnitQuickcheck.class)
23 @Contract(
" -> !null")
30 public ExpectedException thrown = ExpectedException.none();
33 public void numberOfDataPoints(Integer dataPoints){
34 provider.setNumberOfDataPoints(dataPoints);
35 assertEquals(dataPoints, provider.getNumberOfDataPoints());
39 public void pollingIntervalBiggerThanZero(Duration pollingInterval){
40 Assume.assumeFalse(pollingInterval.isNegative());
43 provider.setPollingInterval(pollingInterval);
48 assertEquals(pollingInterval, provider.getPollingInterval());
52 public void pollingIntervalLessThanZero(Duration pollingInterval)
throws 54 Assume.assumeTrue(pollingInterval.isNegative());
57 provider.setPollingInterval(pollingInterval);