DependencyProperty tests are ignoring multiple variance of ArgumentException #10323
Labels
Investigate
Requires further investigation by the WPF team.
Test or Test Infrastructure
Improvements of test source code
The issue
In the new tests from #8215 for
DependencyProperty
, there's a lot of re-use of data that are being passed toRegister
methods ofDependencyProperty
.This would be fine on its own when testing for other things, but in tests specifically for
Register
methods, anArgumentException
can be thrown either because the property was already registered (SR.PropertyAlreadyRegistered
) or when auto generation of default property metadata fails (SR.DefaultValueAutoAssignFailed
).This can cause flaky unit test results that do not clearly express where the problem is and require further debugging.
Failure example
For example,
Register_InvokeStringTypeTypeValidateFail_Throws
will fail if ran together withRegister_InvokeStringTypeType_Success
on thecallCount
assertion, becauseRegister
throwsArgumentException
,however due to the fact that the property was previously registered, not because the actual test case fails.
Other information
I will fix these myself by proper comparison of resource messages but I guess that will require first fixing the correct internals visibility between WindowsBase and WindowsBase.Tests or my VS is flaky at the moment. Assign to me please as I cannot without triage rights.
The text was updated successfully, but these errors were encountered: