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

Fixed feature test for XmlAttributeProperties.GetXmlNamespaceMaps and XmlAttributeProperties.SetXmlNamespaceMaps #264

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

anjali-wpf
Copy link
Member

@anjali-wpf anjali-wpf commented Jan 30, 2024

Description

Fixed feature test for issue : XmlAttributeProperties.GetXmlNamespaceMaps throws System.InvalidCastException

Regression

None

Testing

Internal testing done, no new failures encountered.

Risk

None

Microsoft Reviewers: Open in CodeFlow

try
{
XmlAttributeProperties.SetXmlNamespaceMaps(dobj, "foo");
//Pass null to both dependencyObject and value in SetXmlNamespaceMaps, this will throw exception
XmlAttributeProperties.SetXmlNamespaceMaps(null, null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we are testing whether SetXmlNamespaceMaps throws exception when setting null instead of testing if we can set the namespace maps with a correct value.

I am not aware if we have such a test case already. If not, I think we should add one.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we are testing for null value just to see if it results in exception or not because SetXmlNamespaceMaps will throw exception in that scenario.
However for the correct value test we are checking that as well, please refer the code snippet from line 237 to 262.

try
{
XmlAttributeProperties.GetXmlNamespaceMaps(dobj);
//Pass null to dependencyObject in GetXmlNamespaceMaps, this will throw exception
XmlAttributeProperties.GetXmlNamespaceMaps(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here as well I think we should have a test case where we test whether we can get the correct value from the namespace maps or not.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refer the code snippet from line 237 to 262.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants