testfx icon indicating copy to clipboard operation
testfx copied to clipboard

`TestMethodValidatorTests` are not testing what they are supposed to test.

Open Youssef1313 opened this issue 1 year ago • 2 comments

All tests in there that use mocked method info are not setting up IsPublic to return true, meaning that ISValidTestMethod returns false just because IsPublic is false regardless of the scenario meant by other setup parts.

For example (putting aside that we are working on supporting generics), the tests that are asserting generic methods return false will still pass if that part regressed, because it will then return false still as IsPublic is false.

Youssef1313 avatar Dec 02 '24 12:12 Youssef1313

Are those some of the mocked up tests? I had the same feeling, and started doing this, but failed to finish for lack of time. And also because we test a lot of things that would clash without assembly isolation. https://github.com/microsoft/testfx/pull/2925

nohwnd avatar Dec 02 '24 12:12 nohwnd

@nohwnd Yup, they are the mocked tests. The PR you referenced touched the ones I was referring to (and more). It would be nice to fix these up.

Youssef1313 avatar Dec 02 '24 12:12 Youssef1313