dotnet / codeformatter

Tool that uses Roslyn to automatically rewrite the source to follow our coding styles
MIT License
1.24k stars 244 forks source link

XUnitConverter: Add support for converting TestInitialize and TestCleanup attributes to xUnit equivalent #247

Open tiesmaster opened 7 years ago

tiesmaster commented 7 years ago

I used the converter to successfully convert our MSTest projects to xUnit, except that I noticed that TestInitialize and TestCleanup attributes were not converted, so I've added that in my own branch (here).

I think it would be a good addition to the converter, are you guys willing to merge that in? I think the branch requires some work to get it up to PR level, but I don't want to do that if it's not going to be merged ;)

tiesmaster commented 7 years ago

@alexsorokoletov Seeing you've been going through a number of issues on this project, how about this one? Interested in a PR for this?

alexsorokoletov commented 7 years ago

@tiesmaster I'm not a reviewer on this project :) did a contribution while ago. @jaredpar is the boss ;)

chrivo commented 4 years ago

@tiesmaster Seems this issue is closed. I see code that looks like it does replace TestInitialize and TestCleanup. I can not test it, though, becase I have another issue (wich I posted here, recently)

tiesmaster commented 4 years ago

Hi @chrivo, exactly for this purpose I created a permanent fork out of this part of the project. See my rationale for that here. In case you're wondering why I said: "it's not being maintained anymore, and contributions are declined". That has been my experience on this project, and that's backed by various comments of Microsoft employees, such as this one here.

I specifically added support for the TestInitialize / TestCleanup methods, and successfully used that to convert a project at my previous employer. I'd encourage you to checkout my fork, and try that out. If you run into problems, then I can help you out, but please post on that fork, since it's intended as a supported replacement of the copy here.


You're having trouble getting the project to run in the first place, as you've mentioned in #289. As mentioned, that because this is unmaintained. However, xunit-converter might also not work, depending it's targeting a .NET Core project, or the "legacy" .NET Framework, as I mentioned in the comment. What do you have?


BTW This repo has a successor for just the code formatting functionality dotnet-format, which is supported, and actually quite active.

chrivo commented 4 years ago

@tiesmaster Thanks for your answer! I cloned your fork and it also doesn't work entirely. However, I'm getting much closer, but there is another issue. I posted this issue in your fork: https://github.com/tiesmaster/xunit-converter/issues/4. Let's have any further conversation on this there.