import { assertEquals } from "https://deno.land/std@0.157.0/testing/asserts.ts";
import AuthenticationManager from "./index.ts";
Deno.test("design-authentication-manager", () => { const authenticationManager = new AuthenticationManager(5); authenticationManager.renew("aaa", 1); authenticationManager.generate("aaa", 2); assertEquals(1, authenticationManager.countUnexpiredTokens(6)); authenticationManager.generate("bbb", 7); authenticationManager.renew("aaa", 8); authenticationManager.renew("bbb", 10); assertEquals(0, authenticationManager.countUnexpiredTokens(15)); });