You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
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.
IsFrameworkTestProject I'm a bit torn here. On the one hand, I'd like to say that the check for the test project-type-id suffices. On the other hand, I'm fairly certain that most of my old .NET framework test projects where classlibs from a project-id view. I think I would "reduce" it to checking the project type id.
IsTestProject determines if it's any kind of test or test-like project. Looks fine, but implementation would need to change after my proposed change for IsFrameworkTestProject. (See below)
Determine a specific test framework
This is IsXUnitTestProject, IsFsUnitTestProject, IsNUnitTestProject, IsExpectoTestProject, IsFixieTestProject and IsMSTestProject which all lead to IsTestProjectOfType. And here, I think, for determining the test framework in use the fact that a project is a IsFrameworkTestProject or IsDotNetCliTestProject does not matter. I would remove that and check only for reference/package.
So.. I think the testing-related extensions should be re-worked as follows:
IsDotNetCliTestProject: Stays as it is - It checks if dotnet test should work, free from any test frameworks.
IsFrameworkTestProject: Remove the checks for the test framework, so that a .NET framework test project is a project that has the "correct" project type id. (Again, free from the test framework in use.)
Is[whatever framwork]TestProject: Check only for the test framework references. This would mean removing the check for IsNetStandard and IsType(ProjectType.Test) from IsTestProjectOfType.
IsTestProject - this would essentially keep it's old meaning but since IsFrameworkTestProject has changed a bit, this would need to be modified to IsDotNetCliTestProject or IsFrameworkTestProject or Is[any of the known frameworks]TestProject
@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.
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
The text was updated successfully, but these errors were encountered: