use of uk.ac.sussex.gdsc.smlm.results.count.Counter in project GDSC-SMLM by aherbert.
the class CounterTest method canIncrementAndGet.
@Test
void canIncrementAndGet() {
Counter counter = new Counter();
Assertions.assertEquals(1, counter.incrementAndGet());
Assertions.assertEquals(2, counter.incrementAndGet());
Assertions.assertEquals(3, counter.incrementAndGet());
counter = new Counter();
Assertions.assertEquals(10, counter.incrementAndGet(10));
Assertions.assertEquals(20, counter.incrementAndGet(10));
Assertions.assertEquals(30, counter.incrementAndGet(10));
}
use of uk.ac.sussex.gdsc.smlm.results.count.Counter in project GDSC-SMLM by aherbert.
the class CounterTest method canDecrementAndGet.
@Test
void canDecrementAndGet() {
Counter counter = new Counter();
Assertions.assertEquals(-1, counter.decrementAndGet());
Assertions.assertEquals(-2, counter.decrementAndGet());
Assertions.assertEquals(-3, counter.decrementAndGet());
counter = new Counter();
Assertions.assertEquals(-10, counter.decrementAndGet(10));
Assertions.assertEquals(-20, counter.decrementAndGet(10));
Assertions.assertEquals(-30, counter.decrementAndGet(10));
}
Aggregations