Find Tests for a Symbol
find_tests_forFind test methods likely covering a C# symbol via static analysis—calls, reads, construction, or name. Use it to see what pins a symbol before changes and to select tests after.
Instructions
Find the test cases that likely cover a symbol: test methods that call it, read it, build it or are named after it. Static evidence, not a coverage run; coverage_gaps asks the reverse for a scope.
Use it before changing a symbol, to see what pins it, and after, to pick tests. Only a method that itself carries a test attribute counts (by default Fact, Theory, Test, TestMethod, TestCase).
Returns items [{testType, testMethod, project, matchReason}], count, totalFound, truncated (at most 50), invokesTotal, dispatchTotal (omitted at 0) and an optional 'note' after the list. matchReason is one of nine tiers, in sort order: 'invokes' (the test calls the target), 'invokes-via' (through one method or constructor it calls), '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 or abstract member the target implements; a test double may have run instead), 'dispatch-via' and 'name' (a guess: the test's or its class's name mentions the symbol - for Type.Member, both names). The first six are strong. invokesTotal counts the strong rows and dispatchTotal the contract rows over the whole result, so totalFound minus both is the name guesses.
The evidence reaches two hops at most - the test and one method or constructor it calls or getter it reads - so a deeper chain is not counted, and an empty answer is not 'nothing pins this'. The 'note' says so on an empty answer, and names the other cases where numbers mislead: an undeclared name or type segment (every hit is name noise), an event or enum member (only the name tier can match), a nested type in the 'Outer.Inner' form, a constructor query, contract rows, construction rows (matched on the type's simple name, so a namesake counts too).
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.
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. |