{"record":{"id":"fba758da673245ee","repo":"stride3d/stride","slug":"no-uitest-class-named-testclassname-in-testdllpath-available","errorCode":null,"errorMessage":"No [UITest] class named '{testClassName}' in '{testDllPath}'. Available: {string.Join(\", \", candidates.Select(t => t.FullName))}","messagePattern":"No \\[UITest\\] class named '(.+?)' in '(.+?)'\\. Available: (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/editor/Stride.GameStudio.AutoTesting/UITestHost.cs","lineNumber":162,"sourceCode":"            return true;\n        }\n        return false;\n    }\n\n    private IUITest LoadTest()\n    {\n        var asm = Assembly.LoadFrom(testDllPath);\n        var candidates = asm.GetTypes()\n            .Where(t => t.GetCustomAttribute<UITestAttribute>() is not null)\n            .ToList();\n        if (candidates.Count == 0)\n            throw new InvalidOperationException($\"No [UITest] class found in '{testDllPath}'.\");\n\n        Type chosen;\n        if (testClassName is not null)\n        {\n            chosen = candidates.FirstOrDefault(t => t.Name == testClassName || t.FullName == testClassName)\n                ?? throw new InvalidOperationException($\"No [UITest] class named '{testClassName}' in '{testDllPath}'. Available: {string.Join(\", \", candidates.Select(t => t.FullName))}\");\n        }\n        else if (candidates.Count == 1)\n        {\n            chosen = candidates[0];\n        }\n        else\n        {\n            throw new InvalidOperationException($\"Multiple [UITest] classes in '{testDllPath}'; pass --test-name to select. Available: {string.Join(\", \", candidates.Select(t => t.FullName))}\");\n        }\n\n        if (!typeof(IUITest).IsAssignableFrom(chosen))\n            throw new InvalidOperationException($\"[UITest] class {chosen.FullName} must implement IUITest.\");\n\n        return (IUITest)Activator.CreateInstance(chosen)!;\n    }\n\n    private void RunTest(IUITest test, Context ctx)\n    {","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/editor/Stride.GameStudio.AutoTesting/UITestHost.cs#L144-L180","documentation":"LoadTest resolves the requested test class by name among the [UITest]-annotated candidates in the DLL. If a --test-name was given but no candidate's Name or FullName matches, it throws InvalidOperationException listing the available test class names. This distinguishes a bad test selection from a DLL with no tests at all.","triggerScenarios":"Passing --test-name with a class name that does not match any [UITest] class (wrong name, renamed class, or typo).","commonSituations":"A test class was renamed after scripts/CI were written; using the namespace-less short name when the attribute search expects exact Name or FullName; copy-pasting a test name from another project.","solutions":["Use one of the names listed in the error message (FullName or short Name).","Run without --test-name if the DLL has exactly one test class so it is auto-selected.","Fix the class name in the test project or update the CI/script argument.","List candidates by scanning the DLL for [UITest] before running to confirm spelling."],"exampleFix":"// before\ndotnet Stride.GameStudio.AutoTesting.dll --test-dll MyTests.dll --test-name MyGameTest\n// after (class is MyGameTests)\ndotnet Stride.GameStudio.AutoTesting.dll --test-dll MyTests.dll --test-name MyGameTests","handlingStrategy":"validation","validationCode":"var names = asm.GetTypes()\n    .Where(t => t.GetCustomAttribute<UITestAttribute>() is not null)\n    .SelectMany(t => new[] { t.Name, t.FullName });\nif (testName is not null && !names.Contains(testName))\n    throw new InvalidOperationException($\"Unknown test '{testName}'. Available: {string.Join(\", \", names)}\");","typeGuard":null,"tryCatchPattern":"try { test = LoadTest(dll, testName); }\ncatch (InvalidOperationException ex) { PrintAvailableTests(); return 1; }","preventionTips":["Copy test names from the error's Available list","Update scripts when renaming test classes","Prefer FullName in --test-name"],"tags":["testing","cli-argument","uitest"],"backgroundTag":"invalid-cli-argument","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}