You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -52,28 +51,6 @@ public class MyTestClass : RevitApiTest
52
51
53
52
This is your runnable test. The `[TestExecutor<RevitThreadExecutor>]` attribute ensures the test executes within Revit's single-threaded API context.
54
53
55
-
### Global executor configuration
56
-
57
-
To avoid repeating the `TestExecutor` attribute for every test, you can [register](https://tunit.dev/docs/advanced/extension-points/#registering-a-test-executor) the executor globally using one of the following methods:
58
-
59
-
- Add the attribute to any .cs file in your project (e.g., AssemblyInfo.cs):
**TUnit** is built on top of the **Microsoft.Testing.Platform**. Combined with source-generated tests, running your tests is available in multiple ways.
@@ -135,62 +112,135 @@ public sealed class RevitApplicationTests : RevitApiTest
135
112
136
113
## Document testing
137
114
138
-
Test document-specific operations with setup and cleanup:
115
+
Tests that pass alone but fail together are a classic sign of shared state. Give each test its own document — created in `[Before(Test)]`, closed in `[After(Test)]` — and that problem disappears entirely.
116
+
Use the setup hook to seed the document with exactly the state each test needs.
117
+
The `[HookExecutor<RevitThreadExecutor>]` attribute ensures hooks also run on Revit's thread:
> The examples demonstrate basic testing functionality. This library **only adds support for working within the Revit API context**. For comprehensive documentation on assertions, attributes, test configuration, and
196
187
> advanced features, please refer to the official [TUnit documentation](https://thomhurst.github.io/TUnit/).
188
+
189
+
More examples, including parametrized model and family tests, are available in the [test project](https://github.com/Nice3point/RevitUnit/tree/main/Nice3point.TUnit.Revit.Tests).
190
+
191
+
## Test configuration
192
+
193
+
### Global executor
194
+
195
+
To avoid repeating the `TestExecutor` attribute for every test, you can [register](https://tunit.dev/docs/advanced/extension-points/#registering-a-test-executor) the executor globally using one of the following methods:
196
+
197
+
- Add the attribute to any .cs file in your project (e.g., TestsConfiguration.cs):
The `RevitLanguage` attributeacceptsa [language](https://help.autodesk.com/view/RVT/2026/ENU/?guid=GUID-BD09C1B4-5520-475D-BE7E-773642EEBD6C) name (e.g., "English - United States"), code (e.g., "ENU")
246
+
or [LanguageType](https://www.revitapidocs.com/2026/dfda33cf-cbff-9fde-6672-38402e87510f.htm) enum value (e.g., "English_GB" or "15").
0 commit comments