use tiny_counter::{EventStore, TimeUnit};
#[test]
fn allowed_returns_true_when_check_passes() {
let store = EventStore::new();
let allowed = store
.limit()
.at_most("action", 10, TimeUnit::Hours)
.allowed("action");
assert!(allowed);
}
#[test]
fn allowed_returns_false_when_check_fails() {
let store = EventStore::new();
for _ in 0..10 {
store.record("action");
}
let allowed = store
.limit()
.at_most("action", 10, TimeUnit::Hours)
.allowed("action");
assert!(!allowed);
}