# LibTmux.Testing.TmuxTestFactory

- **Module:** LibTmux.Testing
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/6656a563ec9e07ab52e0c3ac96f7704fc94cc0c0/src/LibTmux/Testing/TmuxTestFactory.cs#L13
- **Page:** https://libtmux.org/reference/dotnet/libtmux-testing-tmuxtestfactory/

Makes the tmux objects a test needs, each owning its own cleanup.

Every scope this hands out is disposable, and disposing unwinds as far as
the scope owns: a session scope removes the session, a server scope kills
the server. A test that takes a scope therefore cannot leak a tmux server,
even when it fails part way through.

## Members

- `TmuxTestFactory` (method) — Initializes a factory.
- `CreateContextAsync` (method) — Starts a server this test owns, with its environment.
- `CreateServerAsync` (method) — Starts a server this test owns.
- `CreateSessionAsync` (method) — Starts a server and a session in it, both owned by this test.
- `CreateWindowAsync` (method) — Starts a server, a session, and a window, all owned by this test.
- `CreateHierarchyAsync` (method) — Starts a server, session, window, and pane a test can type into.
