Open StingyJack opened 3 years ago
Sorry I didn't see this for some reason. Like the other issue, I may just remove support for generating the projects as it's never been that great.
Its easy to work around and would probably save you a ton of maintenance.
Without that do the config options still need to be present? Are the target projects test framework and mocking library detected automatically?
Are the target projects test framework and mocking library detected automatically?
No, but that is definitely something we could do. Also, since it has support for setting those in a config file - yes the default options become much less useful. But I guess they make sense from a discoverability standpoint at least (for new users).
So https://github.com/mattwhitfield/unittestgenerator has some updates for this. It will auto-detect the target frameworks, as well as selectively use FluentAssertions if that is present. The project generation is gone now - but the options for framework are still there (they are used if you allow generation without a target project) - they just get over-ridden if you have turned on auto-detection (which will be on by default).
A new version should be out in a couple of weeks - but it will have to be a different item in the marketplace as I no longer work for SentryOne 👍
@mattwhitfield - if a new version comes out and you cant mention it here, please create an issue in any of my repos to let me know about it, Even with some of the issues this one has its still earned a spot in my toolbox and recommendations when someone I work with asks about VS extensions.
Fixed in https://marketplace.visualstudio.com/items?itemName=MattWhitfield.Unitverse - and thanks, really appreciate it. If there are some issues outstanding for you, then please do let me know via https://github.com/mattwhitfield/unittestgenerator/issues 👍
@StingyJack just wanted to tag you in case you hadn't seen ^
This seems to have problems with packages. I right clicked on a target assembly and chose Generate Tests and it started to and then put up a full screen error dialog
I figure there is some problem relating to private packages, so in the options I told it not to install referenced packages and changed it to use MSTest and Moq, deleted the csproj file and its folder that were created and repeated the test generation. This time generation worked,. except that running tests didnt work and reported this in the output window
So I added the private nuget package and the MSTest adapter and then set the target framework to be netcoreapp31 (cant be netstandard for a reason I have read but disagree with) and that resolved the above error, and building now discovers the tests. However, running them reports
No tests found to run.
still. So I'm going to try a reboot, but figured I'd share this in case you wanted to know.EDIT: After adding another empty unit test project from the VS templates, the basic package set is
I was missing the first one in the generated project. Adding it fixes the test discovery problem