diff --git a/src/Test/DigitalDocuments/DRT/Core/PackScheme/DrtPackScheme.cs b/src/Test/DigitalDocuments/DRT/Core/PackScheme/DrtPackScheme.cs index b59bdf773..036425423 100644 --- a/src/Test/DigitalDocuments/DRT/Core/PackScheme/DrtPackScheme.cs +++ b/src/Test/DigitalDocuments/DRT/Core/PackScheme/DrtPackScheme.cs @@ -958,4 +958,3 @@ private void DumpRequest(WebRequest request) } } } - diff --git a/src/Test/XAML/FeatureTests/XamlTests35/Microsoft/Test/Xaml/Parser/MethodTests/XmlContent/XmlHandlingTest.cs b/src/Test/XAML/FeatureTests/XamlTests35/Microsoft/Test/Xaml/Parser/MethodTests/XmlContent/XmlHandlingTest.cs index 444cd48bf..f5e1370bb 100644 --- a/src/Test/XAML/FeatureTests/XamlTests35/Microsoft/Test/Xaml/Parser/MethodTests/XmlContent/XmlHandlingTest.cs +++ b/src/Test/XAML/FeatureTests/XamlTests35/Microsoft/Test/Xaml/Parser/MethodTests/XmlContent/XmlHandlingTest.cs @@ -14,6 +14,7 @@ using System.Windows.Threading; using Microsoft.Test.Serialization; using System.Windows.Media; +using Microsoft.Test.Logging; using Microsoft.Test.Discovery; using Microsoft.Test.Xaml.Utilities; @@ -210,36 +211,60 @@ public void VerifyXmlAttributeProperties() // GetXmlNamespaceMaps(DependencyObject dependencyObject) // SetXmlNamespaceMaps(DependencyObject dependencyObject, string value) // - // NOTE: These methods are broken and won't be fixed. We're just calling - // them to keep them off the radar. The exception verification will - // alert us if the implementation is ever fixed. - // - Exception ex = null; + try { - //commenting this for now - api got updated and for making it work we need to update tests as well - //PR has been raised already, once reviewed, this code will be updated - //XmlAttributeProperties.SetXmlNamespaceMaps(dobj, "foo"); + //Pass null to both dependencyObject and value in SetXmlNamespaceMaps, this will throw exception + XmlAttributeProperties.SetXmlNamespaceMaps(null, null); + } catch (Exception e) { - ex = e; + GlobalLog.LogStatus("Exception is expected. Exception in SetXmlNamespaceMaps : " + e.ToString()); } - if (ex == null) throw new Microsoft.Test.TestValidationException("FAILED"); - - ex = null; + try { - XmlAttributeProperties.GetXmlNamespaceMaps(dobj); + //Pass null to dependencyObject in GetXmlNamespaceMaps, this will throw exception + XmlAttributeProperties.GetXmlNamespaceMaps(null); } catch (Exception e) { - ex = e; + GlobalLog.LogStatus("Exception is expected. Exception in GetXmlNamespaceMaps : " + e.ToString()); + } + + //Pass value in SetXmlNamespaceMaps, then verify if the value is set correctly by GetXmlNamespaceMaps + + DependencyObject dObj = new DependencyObject(); + Hashtable hashTable = new Hashtable(); + var hashTableKey = "dummyKey"; + var hashTableValue = "dummyValue"; + hashTable.Add(hashTableKey, hashTableValue); + XmlAttributeProperties.SetXmlNamespaceMaps(dObj, hashTable); + var xmlNamespaceMapsValue = XmlAttributeProperties.GetXmlNamespaceMaps(dObj); + + if (xmlNamespaceMapsValue.GetType() == typeof(Hashtable)) + { + foreach (DictionaryEntry entry in xmlNamespaceMapsValue) + { + _IsStringEqual(entry.Key.ToString(), hashTableKey); + if (entry.Value != null) + { + _IsStringEqual(entry.Value.ToString(), hashTableValue); + } + else + { + throw new Microsoft.Test.TestValidationException("Value is unexpected. Expected:" + hashTableValue + ", Actual:null"); + } + } + } + else + { + throw new Microsoft.Test.TestValidationException("Value is unexpected. Expected:" + typeof(Hashtable) + ", Actual:" + xmlNamespaceMapsValue.GetType()); } - - if (ex == null) throw new Microsoft.Test.TestValidationException("FAILED"); } - // Checks that 2 string values are equalivalent. + + // Checks that 2 string values are equivalent. private static void _IsStringEqual(string expected, string actual) { if (actual == null)