@@ -131,18 +131,19 @@ function! s:run.single.test(testName, bufferTests) abort
131131 let currentTest = currentTest[0 ]
132132 let project = OmniSharp#GetHost (bufnr ).project
133133 let targetFramework = project.MsBuildProject.TargetFramework
134+ let currentTestName = substitute (currentTest.name, ' (.*)$' , ' ' , ' ' )
134135 let opts = {
135136 \ ' ResponseHandler' : funcref (' s:run.process' , [s: run .single.complete , bufnr , tests]),
136137 \ ' BufNum' : bufnr ,
137138 \ ' Parameters' : {
138- \ ' MethodName' : substitute (currentTest.name, ' (.*)$ ' , ' ' , ' ' ) ,
139+ \ ' MethodName' : currentTestName ,
139140 \ ' NoBuild' : get (s: , ' nobuild' , 0 ),
140141 \ ' TestFrameworkName' : currentTest.framework,
141142 \ ' TargetFrameworkVersion' : targetFramework
142143 \ },
143144 \ ' SendBuffer' : 0
144145 \}
145- echomsg ' Running test ' . currentTest.name
146+ echomsg ' Running test ' . currentTestName
146147 call OmniSharp#stdio#Request (' /v2/runtest' , opts)
147148endfunction
148149
@@ -243,7 +244,7 @@ function! s:run.multiple.inBuffer(bufnr, tests, Callback) abort
243244 \ ' ResponseHandler' : funcref (' s:run.process' , [a: Callback , a: bufnr , a: tests ]),
244245 \ ' BufNum' : a: bufnr ,
245246 \ ' Parameters' : {
246- \ ' MethodNames' : map (copy (a: tests ), {i ,t - > t .name}),
247+ \ ' MethodNames' : map (copy (a: tests ), {i ,t - > substitute ( t .name, ' (.*)$ ' , ' ' , ' ' ) }),
247248 \ ' NoBuild' : get (s: , ' nobuild' , 0 ),
248249 \ ' TestFrameworkName' : a: tests [0 ].framework,
249250 \ ' TargetFrameworkVersion' : targetFramework
@@ -427,7 +428,6 @@ function! s:utils.extractTests(bufnr, codeElements) abort
427428 let testStart = min (filter (copy (testlines), {_,l - > l >= testStart}))
428429 for dt in OmniSharp#GetHost (a: bufnr ).project.tests
429430 if dt.CodeFilePath == # filename && dt.LineNumber == testStart
430- " \ 'name': element.Properties.testMethodName,
431431 call add (tests, {
432432 \ ' name' : dt.FullyQualifiedName,
433433 \ ' framework' : element.Properties.testFramework,
0 commit comments