kokoabim / vscode-development-driven-testing

VS Code extension to generate C#/.NET Xunit test class with test methods
MIT License
0 stars 0 forks source link

Error: Method return type not found #1

Open haraman21 opened 7 months ago

haraman21 commented 7 months ago

Hi

I inherited an asp.net application solution that contains multiple projects without any tests. I started by adding tests to one of the library projects in it, that multi-targets netstandard2.0 and net4.8. This project is a simple library that does not have any complex or web/server parts, but only a few files that simply process intrinsic data types like strings, bool, int, List etc. I have manually added tests to some files with full coverage, some files with partial coverage and all these test run successfully without any issue.

I tried adding new tests to remaining and partially covered files using this extension but I get following error in the output pane: Project/File.cs: Error: Method return type not found. Copy C# Xunit test classes for file and Create C# Xunit test files for file both commands result in same error.

Create C# Xunit test files for project fails with No C# project found. error

No new test files are generated, none of the existing test files are modified. Commands fail immediately with these errors without any processing, be it from code editor or explorer.

kokoabim commented 7 months ago

Sounds like something to do with formatting in the file for issue one, and structure of the project on disk or rather where it was "opened" in VSCode for issue two. Without having access to the project I really can't say. Is this in a public repo?

For issue two, are you opening at the solution level (i.e. directory)?