# `Kinda.Testing.Lifecycle`
[🔗](https://github.com/beaver-lodge/kinda/blob/main/lib/kinda/testing/lifecycle.ex#L1)

Deterministic lifecycle scenarios for owned native resources.

The caller supplies release and probe callbacks, so production resources do
not need test hooks. Every scenario uses a stable seed and reports the exact
release order on failure.

# `resources`

```elixir
@type resources() :: %{required(atom() | binary()) =&gt; term()}
```

# `owner_graph!`

```elixir
@spec owner_graph!([Kinda.Resource.Declaration.t()]) :: %{
  optional(atom() | binary()) =&gt; atom() | binary() | nil
}
```

# `permutations`

```elixir
@spec permutations(
  [Kinda.Resource.Declaration.t()],
  keyword()
) :: [[Kinda.Resource.Declaration.t()]]
```

# `verify!`

```elixir
@spec verify!(
  [Kinda.Resource.Declaration.t()],
  keyword()
) :: :ok
```

Verifies every requested release order using freshly-created resources.

`:setup` returns a map keyed by declaration identity. `:release` receives
the declaration and its corresponding resource. `:probe` runs after every
release with the resources that have not been explicitly released yet.

---

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