BakeoutController-Basic  0.1
A Controller for the Omicron vacuum chamber
pressure_provider/QuickcheckProperties.java
1 package unit.kernel.models.variables.pressure_provider;
2 
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.runner.RunWith;
8 
9 import java.time.Duration;
10 
11 import static org.junit.Assert.assertEquals;
12 import static org.junit.Assert.fail;
13 import static org.junit.Assume.assumeTrue;
14 
18 @RunWith(JUnitQuickcheck.class)
19 public final class QuickcheckProperties extends PressureProviderTestCase {
20  @Contract(" -> !null")
21  @Override
22  protected ExpectationsForPressureProvider getExpectations() throws
23  Exception {
25  }
26 
27  @Property
28  public void numberOfDataPoints(Integer numberOfDataPoints){
29  provider.setNumberOfDataPoints(numberOfDataPoints);
30 
31  assertEquals(numberOfDataPoints, provider.getNumberOfDataPoints());
32  }
33 
34  @Property
35  public void pollingInterval(Duration pollingInterval){
36  assumeTrue(!pollingInterval.isNegative());
37 
38  try {
39  provider.setPollingInterval(pollingInterval);
40  } catch (NegativeDurationException error){
41  fail();
42  }
43 
44  assertEquals(pollingInterval, provider.getPollingInterval());
45  }
46 }
Git Repo