Add a couple tests

This commit is contained in:
Gnat008
2017-03-21 16:48:20 -04:00
parent cfbb3f9a7f
commit ed0126d06c
2 changed files with 42 additions and 8 deletions
@@ -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