Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code fix tests with shared files #1110

Open
bjornhellander opened this issue Jul 21, 2023 · 0 comments
Open

Code fix tests with shared files #1110

bjornhellander opened this issue Jul 21, 2023 · 0 comments
Labels
Area-MS.CA.Testing Microsoft.CodeAnalysis.Testing

Comments

@bjornhellander
Copy link

Hi!

I am writing some code fix tests in which I want to have shared files between projects and wonder if you can offer some help on how to do that realistically.

Case 1 is to have one project reference a file from another projects folder, i.e. a normal link if it had been in a csproj file.
I think I have managed to write these tests. You can find them here: bjornhellander/StyleCopAnalyzers@0ac708d#diff-d30e93cd66e2ce8a34fa51449ec63bb9cd1d7d958d9578b4898be0bd7f80e088. I have added notes in the tests that describe what I think they would correspond to in a real csproj file. Does this look correct, or am I testing something else? :-)

Case 2 is to have two projects in the same folder sharing files, so no links in this case, but still shared files.
How would I configure my CSharpCodeFixTest object to correctly describe this setup?

I hope I managed to explain this ok and would appreciate some help on this. Thanks in advance!

@sharwell sharwell added the Area-MS.CA.Testing Microsoft.CodeAnalysis.Testing label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-MS.CA.Testing Microsoft.CodeAnalysis.Testing
Projects
None yet
Development

No branches or pull requests

2 participants