In xUnit, what determines whether a method is discovered and run as a test?
- aThe method name must start with
Test, since xUnit still relies on naming conventions for discovery, much like some legacy test frameworks required - bThe method must be decorated with
[Fact](or[Theory]), which xUnit's discovery mechanism scans for✓ - cThe method must be
public static voidso the test runner can call it without creating an instance - dThe containing class must implement
ITestCase, an interface xUnit's runner looks for at startup
Explanation:xUnit discovers tests purely through attributes:
[Fact] for a test with no parameters, [Theory] for a data-driven test. There is no naming-convention requirement, no static requirement (xUnit creates an instance per test), and no ITestCase interface to implement.