Supplies Autodesk Revit API tests with documents, services, and data cases. Helps choose between seeded documents, sample .rvt/.rfa files, dependency injection, and test skipping.
Ships in revit-testing. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A fixture is everything a test runs against: the document, the services it calls, and the cases it repeats over. Choosing the wrong one is the usual cause of tests that pass alone but fail together, or that silently test nothing.
These invariants apply to every variant:
RevitApiTest and RevitApiUiTest run every hook on the Revit thread, and every opened or created document is closed in teardown.
A class-level hook requires an explicit [HookExecutor<RevitThreadExecutor>] or [HookExecutor<RevitUiThreadExecutor>].public static string[] DocumentPaths => Directory.EnumerateFiles(directory, "*.rvt").ToArray(); // primitives, off-thread
[After(Test)] // runs on the Revit thread
public void CloseDocument()
{
_document?.Close(false);
}
Match the required state to one reference and open only that reference.
.rvt/.rfa files, or one test body must run for several sample directories, through [InstanceMethodDataSource] and [InheritsTests].[Arguments], [MethodDataSource], and [InstanceMethodDataSource] are basic TUnit data-driven-test features.
A Revit fixture selects among them under the Revit thread constraint.
For other TUnit data sources, read TUnit's Method Data Sources source.
[Arguments] — a small fixed set of inline primitive cases.[MethodDataSource(nameof(Member))] — a static member whose value is fixed at discovery: a computed set of numbers or a static list of sample paths.[InstanceMethodDataSource(nameof(Member))] — an instance member whose value depends on constructor state: a base class parameterized by extension or directory, or a set built from injected configuration.
See parameterized-fixtures.dependency-injection.[After(Test)].[MethodDataSource] for static, [InstanceMethodDataSource] for constructor-dependent.| Pitfall | Correct approach |
|---|---|
| Tests passing alone but failing together | Give each test its own document or state; do not share mutable fixtures. |
| A data source that returns a Revit object | Return primitives or paths; build Revit objects in the test body on the Revit thread. |
[MethodDataSource] on a constructor-dependent member | Use [InstanceMethodDataSource]; TUnit constructs the instance before it reads the member. |
| Opening the sample file in place | Copy it to a temporary path and open the copy. |
| Failing when the samples folder is missing | Return an empty data set (its tests are skipped) or call Skip.Test(...). |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
2 skills in this plugin
/revit-testing:revit-test-fixturesfrom revit-testing
npx claudepluginhub nice3point/revit-skills --plugin revit-testingOther plugins' skills for the same job