cake-contrib / Cake.Incubator

This project contains various experimental but useful extension methods and aliases for Cake
http://cakebuild.net/api/Cake.Incubator/
Other
19 stars 23 forks source link

All unit test library checks returns true for default vs 2015 unit test library #112

Open AdmiringWorm opened 5 years ago

AdmiringWorm commented 5 years ago

I just created a new default Visual Studio 2015 Unit Test Library (I believe it is a MSTest compatible project) for testing purposes.

I found at that this project was detected as pretty much any unit test library that Cake.Incubator have added checks for.

Basically, Cake.Incubator things the project is a XUnit, NUnit, Fixie and a MSTest project (probably Expecto and FsUnit as well, but didn't check those).

I believe the false positives are caused by an incorrect? check in the following helper method: https://github.com/cake-contrib/Cake.Incubator/blob/develop/src/Cake.Incubator/Project/ProjectParserExtensions.cs#L1152

From the look of it, the helper method would return true for any place this in used as long as the project in a Unit Test library, even if it do not have the necessary references/packages.

Project csproj ```xml Debug AnyCPU {5C71F804-526F-42BC-AACF-917BC24DDB04} Library Properties MSUnitTests MSUnitTests v4.5.2 512 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages False UnitTest true full false bin\Debug\ DEBUG;TRACE prompt 4 pdbonly true bin\Release\ TRACE prompt 4 {1791b52a-64e8-426c-8d73-167afcf42f17} ClassLibrary False False False False ```
nils-a commented 3 years ago

Looking at the current implementation, I would mentally "group" the testing-related extensions in two categories:

So.. I think the testing-related extensions should be re-worked as follows:

@AdmiringWorm I think the sketched out changes should fix the problem at hand, what do you think?

I'd be willing to start working on this, but I'd love to hear what everyone thinks of the proposed changes.

/cc @wwwlicious