Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DependencyProperty tests are ignoring multiple variance of ArgumentException #10323

Open
h3xds1nz opened this issue Jan 22, 2025 · 0 comments
Open
Labels
Investigate Requires further investigation by the WPF team.

Comments

@h3xds1nz
Copy link
Contributor

h3xds1nz commented Jan 22, 2025

The issue

In the new tests from #8215 for DependencyProperty, there's a lot of re-use of data that are being passed to Register methods of DependencyProperty.

This would be fine on its own when testing for other things, but in tests specifically for Register methods, an ArgumentException 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 with Register_InvokeStringTypeType_Success on the callCount assertion, because Register throws ArgumentException,
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.

@himgoyalmicro himgoyalmicro added the Investigate Requires further investigation by the WPF team. label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigate Requires further investigation by the WPF team.
Projects
None yet
Development

No branches or pull requests

2 participants