# `Attesto.Test.CodeStoreAgent`
[🔗](https://github.com/XukuLLC/attesto/blob/v2.28.0/lib/attesto/test/code_store_agent.ex#L1)

Agent-backed authorization-code store fixture for a host's tests.

Use this module to define a named, in-memory test double with the
`Attesto.CodeStore` callbacks and helpers for inspecting captured grants.
It is a lightweight fixture, not a production store or a reference for
storage validation and retention. Use `Attesto.Test.CodeStoreContract` to
test a host's store implementation instead.

    defmodule Host.CodeStoreFixture do
      use Attesto.Test.CodeStoreAgent
    end

Start the generated module with `start_supervised!(Host.CodeStoreFixture)`
in a synchronous ExUnit case, or call its `start_link/1` directly. It is
registered under its module name. `reset/0` clears all entries, `count/0`
returns their number, and `peek/1` hashes a raw code and returns its snapshot
or `nil`. `entry/1` hashes a raw code and returns the internal fixture entry,
raising `KeyError` when absent. No ExUnit code runs when Attesto compiles.

# `__using__`
*macro* 

Define a named Agent code-store fixture and its inspection helpers.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
