Add a couple tests
This commit is contained in:
@@ -37,6 +37,21 @@ public class TimedCounterTest {
|
||||
assertThat(counter.get("moto"), equalTo(13));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldDecrementCount() {
|
||||
// given
|
||||
TimedCounter<String> counter = new TimedCounter<>(10, TimeUnit.MINUTES);
|
||||
counter.put("moto", 12);
|
||||
|
||||
// when
|
||||
counter.decrement("hello");
|
||||
counter.decrement("moto");
|
||||
|
||||
// then
|
||||
assertThat(counter.get("hello"), equalTo(0));
|
||||
assertThat(counter.get("moto"), equalTo(11));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldSumUpEntries() {
|
||||
// given
|
||||
|
||||
Reference in New Issue
Block a user