Find Tests for a Symbol
find_tests_forFind C# tests that likely cover a symbol using static call, access, construction, dispatch, or name evidence, so you can assess change impact and choose which tests to run.
Instructions
Find the tests that likely cover a symbol: test methods that call it, read it, build it or are named after it. Static evidence (coverage_gaps asks the reverse).
Use it before a change, to see what pins a symbol, and after, to pick tests. Only a method with a test attribute counts (default: Fact, Theory, Test, TestMethod, TestCase(Source)).
Returns items [{testType, testMethod, project, matchReason}] (+ 'testTypeFullName' where two read alike), count, totalFound, truncated (max 50), invokesTotal, dispatchTotal (omitted at 0) and an optional 'note' after the list. matchReason is one of eleven tiers, sorted: 'invokes' (it calls the target), 'invokes-via' (through one method or constructor), 'command' (it executes the target's command), 'command-via', 'accesses' (it reads or writes the target property or field; for a type, a static one), 'accesses-via', 'constructs' (it builds the target type; type and constructor queries only), 'constructs-via', 'dispatch' (it calls an interface, abstract or virtual member the target implements or overrides; a double may have run), 'dispatch-via' and 'name' (a guess: the test's or its class's name mentions the symbol - for Type.Member, both). The first eight are strong; invokesTotal counts them over the result and dispatchTotal the contract rows, the rest are name guesses.
Evidence reaches one call deep at most (the test's body and one method, constructor or getter it calls). The 'note' says so on an empty answer and on a non-constructor one whose strong rows are all '-via', and names other misleading cases: an undeclared name or type segment (name noise), an event or enum member (name tier only), a nested 'Outer.Inner' type, a constructor query, no strong row, contract rows, construction rows (matched by simple name), overloads unioned, tests left out for only reading a constant. 'namesakes': types sharing the name.
Read-only. symbol is case-sensitive: a type's simple name, a member name bare or as 'Type.Member' (only that type's member), or 'Type.Type' for the constructor.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sessionId": "<sessionId>",
"symbol": "<symbol>"
},
"name": "find_tests_for"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | The type name, or the member name - bare or in the qualified Type.Member form - to find covering tests for. | |
| sessionId | Yes | The session_id returned by analyze_solution. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use. |