Skip to content

修复找不到测试方法#25

Merged
walterlv merged 10 commits intomasterfrom
t/lindexi/FixNotFoundName
Jul 19, 2025
Merged

修复找不到测试方法#25
walterlv merged 10 commits intomasterfrom
t/lindexi/FixNotFoundName

Conversation

@lindexi
Copy link
Member

@lindexi lindexi commented Jul 14, 2025

同时修复 #24

当前的进入的堆栈如下

+   methodInfo  {Microsoft.VisualStudio.TestTools.UnitTesting.Internal.ReflectionTestMethodInfo}  System.Reflection.MethodInfo {Microsoft.VisualStudio.TestTools.UnitTesting.Internal.ReflectionTestMethodInfo}

public string? GetDisplayName(MethodInfo methodInfo, object?[]? data)

> FukokayrawobelbayNadojearchehi.dll!FukokayrawobelbayNadojearchehi.ContractTestCaseAttribute.GetDisplayName(System.Reflection.MethodInfo methodInfo = {Microsoft.VisualStudio.TestTools.UnitTesting.Internal.ReflectionTestMethodInfo}, object[] data = {object[1]}) 行 68  C#
  Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll!Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestMethodRunner.ExecuteTestWithDataSourceAsync(Microsoft.VisualStudio.TestTools.UnitTesting.ITestDataSource testDataSource = {FukokayrawobelbayNadojearchehi.ContractTestCaseAttribute}, object[] data = {object[1]})  未知
  Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll!Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestMethodRunner.TryExecuteFoldedDataDrivenTestsAsync(System.Collections.Generic.List<Microsoft.VisualStudio.TestTools.UnitTesting.TestResult> results = Count = 0) 未知
  Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll!Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestMethodRunner.RunTestMethodAsync() 未知
  Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll!Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestMethodRunner.ExecuteAsync.__SafeRunTestMethodAsync|0(string initializationLogs = null, string initializationErrorLogs = null, string initializationTrace = null, string initializationTestContextMessages = null) 未知
  Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll!Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestMethodRunner.ExecuteAsync(string initializationLogs = null, string initializationErrorLogs = null, string initializationTrace = null, string initializationTestContextMessages = null)  未知
  Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll!Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.UnitTestRunner.RunSingleTestAsync(Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel.TestMethod testMethod = {Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel.TestMethod}, System.Collections.Generic.IDictionary<string, object> testContextProperties = Count = 8, Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging.IMessageLogger messageLogger = {Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Adapter.FrameworkHandle}) 未知
  Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll!Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestExecutionManager.ExecuteTestsWithTestRunnerAsync(System.Collections.Generic.IEnumerable<Microsoft.VisualStudio.TestPlatform.ObjectModel.TestCase> tests = {Microsoft.VisualStudio.TestPlatform.ObjectModel.TestCase[1]}, Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter.ITestExecutionRecorder testExecutionRecorder = {Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Adapter.FrameworkHandle}, string source = "C:\\lindexi\\Code\\lindexi_gd\\lindexi_gd\\Workbench\\FukokayrawobelbayNadojearchehi\\bin\\Debug\\net9.0\\FukokayrawobelbayNadojearchehi.dll", System.Collections.Generic.IDictionary<string, object> sourceLevelParameters = Count = 8, Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.UnitTestRunner testRunner = {Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.UnitTestRunner}, bool usesAppDomains = false) 未知
  Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll!Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestExecutionManager.ExecuteTestsInSourceAsync.AnonymousMethod__8() 未知
  System.Private.CoreLib.dll!System.Threading.Tasks.Task<System.Threading.Tasks.Task>.InnerInvoke() 未知
  System.Private.CoreLib.dll!System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread threadPoolThread = {System.Threading.Thread}, System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) 未知
  System.Private.CoreLib.dll!System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref System.Threading.Tasks.Task currentTaskSlot = Id = 1, Status = Running, Method = "System.Threading.Tasks.Task <ExecuteTestsInSourceAsync>b__8()", Result = "{Not yet computed}", System.Threading.Thread threadPoolThread)  未知
  System.Private.CoreLib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch()  未知
  System.Private.CoreLib.dll!System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() 未知

这就导致原本通过调用堆栈的方式找不到测试方法

由于找不到正确的测试方法,导致后续的空异常。尽管这个项目标记了很多可空,但事实上没有真的处理正确。先保持现在的写法,等待哪个伙伴肯将其更新

@walterlv walterlv merged commit 4541b7e into master Jul 19, 2025
6 checks passed
@walterlv walterlv deleted the t/lindexi/FixNotFoundName branch July 19, 2025 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants