Author: spouliot
Date: 2005-05-02 08:51:40 -0400 (Mon, 02 May 2005)
New Revision: 43877

Modified:
   
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog
   
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/SignedXmlTest.cs
   
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NTransformTest.cs
   
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NWithCommentsTransformTest.cs
   
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigXsltTransformTest.cs
Log:
2005-05-02  Sebastien Pouliot  <[EMAIL PROTECTED]>

        * SignedXmlTest.cs: AddObject and AddReference now throws 
        ArgumentNullException in 2.0.
        * XmlDsigC14NWithCommentsTransformTest.cs: InputType was fixed in 2.0.
        * XmlDsigC14NTransformTest.cs: InputType was fixed in 2.0.
        * XmlDsigXsltTransformTest.cs: Fixed tests for 2.0, InputType, Empty 
        XSLT and invalid XSLT (new exception).



Modified: 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog
===================================================================
--- 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog 
    2005-05-02 11:11:15 UTC (rev 43876)
+++ 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog 
    2005-05-02 12:51:40 UTC (rev 43877)
@@ -1,3 +1,12 @@
+2005-05-02  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * SignedXmlTest.cs: AddObject and AddReference now throws 
+       ArgumentNullException in 2.0.
+       * XmlDsigC14NWithCommentsTransformTest.cs: InputType was fixed in 2.0.
+       * XmlDsigC14NTransformTest.cs: InputType was fixed in 2.0.
+       * XmlDsigXsltTransformTest.cs: Fixed tests for 2.0, InputType, Empty 
+       XSLT and invalid XSLT (new exception).
+
 2005-04-28  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * XmlDsigXPathTransformTest.cs: Marked FunctionHereObsolete (ignored)

Modified: 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/SignedXmlTest.cs
===================================================================
--- 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/SignedXmlTest.cs
      2005-05-02 11:11:15 UTC (rev 43876)
+++ 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/SignedXmlTest.cs
      2005-05-02 12:51:40 UTC (rev 43877)
@@ -363,8 +363,24 @@
                        AsymmetricAlgorithm aa2 = sxe.PublicGetPublicKey ();
                        AssertNull ("Second Public Key is null", aa2);
                }
+#if NET_2_0
+               [Test]
+               [ExpectedException (typeof (ArgumentNullException))]
+               public void AddObject_Null () 
+               {
+                       SignedXml sx = new SignedXml ();
+                       sx.AddObject (null);
+               }
 
                [Test]
+               [ExpectedException (typeof (ArgumentNullException))]
+               public void AddReference_Null () 
+               {
+                       SignedXml sx = new SignedXml ();
+                       sx.AddReference (null);
+               }
+#else
+               [Test]
                public void Add_Null () 
                {
                        SignedXml sx = new SignedXml ();
@@ -372,7 +388,7 @@
                        sx.AddObject (null);
                        sx.AddReference (null);
                }
-
+#endif
                [Test]
                [ExpectedException (typeof (CryptographicException))]
                public void GetXml_WithoutInfo () 

Modified: 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NTransformTest.cs
===================================================================
--- 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NTransformTest.cs
   2005-05-02 11:11:15 UTC (rev 43876)
+++ 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NTransformTest.cs
   2005-05-02 12:51:40 UTC (rev 43877)
@@ -177,10 +177,14 @@
                }
 
                [Test]
+#if NET_2_0
+               [ExpectedException (typeof (ArgumentException))]
+#else
+               // LAMESPEC: input MUST be one of InputType - but no exception 
is thrown (not documented)
+#endif
                public void LoadInputWithUnsupportedType () 
                {
                        byte[] bad = { 0xBA, 0xD };
-                       // LAMESPEC: input MUST be one of InputType - but no 
exception is thrown (not documented)
                        transform.LoadInput (bad);
                }
 

Modified: 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NWithCommentsTransformTest.cs
===================================================================
--- 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NWithCommentsTransformTest.cs
       2005-05-02 11:11:15 UTC (rev 43876)
+++ 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NWithCommentsTransformTest.cs
       2005-05-02 12:51:40 UTC (rev 43877)
@@ -92,7 +92,11 @@
                        AssertEquals ("Default InnerXml", null, xnl);
                }
 
-               [Test]
+#if NET_2_0
+               [ExpectedException (typeof (ArgumentException))]
+#else
+               // LAMESPEC: input MUST be one of InputType - but no exception 
is thrown (not documented)
+#endif
                public void LoadInputWithUnsupportedType () 
                {
                        byte[] bad = { 0xBA, 0xD };

Modified: 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigXsltTransformTest.cs
===================================================================
--- 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigXsltTransformTest.cs
   2005-05-02 11:11:15 UTC (rev 43876)
+++ 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigXsltTransformTest.cs
   2005-05-02 12:51:40 UTC (rev 43877)
@@ -95,7 +95,11 @@
 
 
                [Test]
+#if NET_2_0
+               [ExpectedException (typeof (ArgumentNullException))]
+#else
                [ExpectedException (typeof (NullReferenceException))]
+#endif
                public void EmptyXslt () 
                {
                        string test = "<Test>XmlDsigXsltTransform</Test>";
@@ -121,19 +125,38 @@
                }
 
                [Test]
-               [ExpectedException (typeof (XsltCompileException))]
                public void InvalidXslt () 
                {
-                       string test = "<xsl:element name='foo' 
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>XmlDsigXsltTransform</xsl:element>";
-                       XmlDocument doc = new XmlDocument ();
-                       doc.LoadXml (test);
+                       bool result = false;
+                       try {
+                               string test = "<xsl:element name='foo' 
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>XmlDsigXsltTransform</xsl:element>";
+                               XmlDocument doc = new XmlDocument ();
+                               doc.LoadXml (test);
 
-                       transform.LoadInnerXml (doc.ChildNodes);
-                       Stream s = (Stream) transform.GetOutput ();
+                               transform.LoadInnerXml (doc.ChildNodes);
+                               Stream s = (Stream) transform.GetOutput ();
+                       }
+#if NET_2_0
+                       catch (Exception e) {
+                               // we must deal with an internal exception
+                               result = (e.GetType ().ToString ().EndsWith 
("XsltLoadException"));
+                               result = true;
+#else
+                       catch (XsltCompileException) {
+                               result = true;
+#endif
+                       }
+                       finally {
+                               Assert ("Exception not thrown", result);
+                       }
                }
 
                [Test]
+#if NET_2_0
+               [ExpectedException (typeof (ArgumentNullException))]
+#else
                [ExpectedException (typeof (NullReferenceException))]
+#endif
                public void OnlyInner () 
                {
                        string test = "<xsl:stylesheet 
xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"; 
xmlns=\"http://www.w3.org/TR/xhtml1/strict\"; version=\"1.0\">";

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to