fscheck / FsCheck

Random Testing for .NET
https://fscheck.github.io/FsCheck/
BSD 3-Clause "New" or "Revised" License
1.15k stars 154 forks source link

xUnit analyzer emits errors on Property tests #636

Closed voroninp closed 4 months ago

voroninp commented 12 months ago

https://github.com/xunit/xunit/issues/2748

so every method which returns Property causes analyzer to emit error.

ploeh commented 12 months ago

What are the implications for FsCheck? Does the analyser also emit errors for the Property attribute? If so, what can we do about it?

Should we have this discussion here? Or would it be more appropriate to have it at https://github.com/xunit/xunit/issues/2748?

voroninp commented 12 months ago

@ploeh

Does the analyser also emit errors for the Property attribute?

Why should it? It just complained about return type.

[Property(MaxTest = 250)]
public Property Merging_2_finite_adjacent_DateRanges_properties() {...}

Or did you mean something else?

ploeh commented 12 months ago

Or did you mean something else?

No, that's a fine example, thank you.

Can we do anything about this in FsCheck? As far as I can tell, this looks as though the xUnit.net analyser produces a false positive.

I suggest continuing the discussion there, or perhaps open a new xUnit.net issue. I'll be happy to jump in over there if my presence is desired.

voroninp commented 12 months ago

I am not very familiar with xUnit architecture, but currently it looks like FsCheck can do nothing.

IMO, the set of allowed types should be defined by TestCaseDiscovererAttribute.

Maybe it's indeed worth that you commen in the original issue.

ploeh commented 12 months ago

OK, comment added: https://github.com/xunit/xunit/issues/2748#issuecomment-1629408107

Please consider joining the discussion.

kurtschelfthout commented 4 months ago

Looks like this was fixed in xunit's analyzers.