DustinCampbell / RoslynNUnitLight

A lightweight framework for writing unit tests for Roslyn diagnostic analyzers, code fixes and refactorings using NUnit,
Other
19 stars 8 forks source link

Add support for mutiple code fix outcomes #7

Open mangeg opened 9 years ago

mangeg commented 9 years ago

Some code fixes return multiple solutions. This adds support for this by adding overload to TestCodeFix(..) to accept an array of strings as expected outcomes.

The expected outcomes has to be passed in the same order as the CodeFixProvider generates the different solutions.

Maybe there is some more elegant way of handling the document instead of re-creating the document and codefixes for each outcome.

cezarypiatek commented 5 years ago

Hi @mangeg ,

I know it's a very long time since this PR was reported. RoslynNUnitLight is in the process of deprecating and the recommended successor is https://github.com/cezarypiatek/RoslynTestKit - this is a newer version of RoslynNUnitLight. Your problem was solved in RoslynTestKit - if you need to test a code that reports multiple code refactorings just provide a value for codeFixIndex parameter. https://github.com/cezarypiatek/RoslynTestKit/blob/master/src/RoslynTestKit/CodeFixTestFixture.cs