Unit Test Stub (symbol)
Uses generate-test to produce a unit-test skeleton for one qualified symbol.
Read this when a routine has no test yet: generate-test produces a unit-test skeleton for one qualified symbol, in DUnitX or DUnit style.
How to run it
Full flag list: generate-test in the CLI reference.
Flags
| Flag | Argument | Meaning | Default |
|---|---|---|---|
--qname | <Foo.TBar.Baz> | ||
--framework | |||
--db | PATH |
Where to click
- RAD Studio main menu: drag-lint > Generate & Export > Unit Test Stub (symbol)...
- Put the caret on the routine in the editor
- Choose drag-lint > Generate & Export > Unit Test Stub (symbol)...
- A unit-test skeleton for the symbol is generated
- From a shell:
drag-lint generate-test --qname <Foo.TBar.Baz> [--framework dunitx|dunit] [--db PATH]
Details
Uses generate-test to produce a unit-test skeleton for one qualified
symbol. Reach for it to scaffold a test file for a routine that has none.
Running it from the CLI
drag-lint generate-test --qname <Foo.TBar.Baz> [--framework dunitx|dunit] [--db PATH]
--qname is the fully qualified symbol; --framework selects dunitx or
dunit.
What it needs
The --db flag is optional -- drag-lint auto-resolves the project's index
when omitted. An index must still exist.
Example
Illustrative only:
drag-lint generate-test --qname MyApp.TCustomerOrder.Total --framework dunitx --db C:\Projects\MyApp\_D-RAG\MyApp.sqlite
This would produce a DUnitX test stub targeting the Total member of
TCustomerOrder.