X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Security%2FTest%2FSystem.Security.Cryptography.Xml%2FReferenceTest.cs;h=01f36abc658abbd7618c9f55003e08c4e60180a9;hb=6f5a0b555436eba699f9dd2659471044097b951b;hp=6801e5c238abdb048ceb7a7fa17fa6c851582b1f;hpb=e8ce970287ee81ce7d38d72fe6f179532d4b6128;p=mono.git diff --git a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ReferenceTest.cs b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ReferenceTest.cs index 6801e5c238a..01f36abc658 100644 --- a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ReferenceTest.cs +++ b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ReferenceTest.cs @@ -23,7 +23,7 @@ namespace MonoTests.System.Security.Cryptography.Xml { protected Reference reference; [SetUp] - void SetUp () + public void SetUp () { reference = new Reference (); } @@ -158,13 +158,18 @@ namespace MonoTests.System.Security.Cryptography.Xml { } [Test] +#if NET_2_0 + [Category ("NotDotNet")] + // MS throws a NullReferenceException (reported as FDBK25886) but only when executed in NUnit + // http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=3596d1e3-362b-40bd-bca9-2e8be75261ff +#endif public void AddAllTransforms () { // adding an empty hash value byte[] hash = new byte [20]; reference.DigestValue = hash; XmlElement xel = reference.GetXml (); - // this is the minimal Reference (DisestValue)! + // this is the minimal Reference (DigestValue)! AssertNotNull ("GetXml", xel); reference.AddTransform (new XmlDsigBase64Transform ()); @@ -217,5 +222,31 @@ namespace MonoTests.System.Security.Cryptography.Xml { // bad hash - there's no validation! reference.DigestMethod = "http://www.w3.org/2000/09/xmldsig#mono"; } + + const string xml = @" + + Alfonso Soriano + 2B + New York Yankees +" ++ @"" ++ @"nDF2V/bzRd0VE3EwShWtsBzTEDc=fbye4Xm//RPUTsLd1dwJPo0gPZYX6gVYCEB/gz2348EARNk/nCCch1f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NtfhNFQ==CN=Test CA (RSA),OU=Engineering,O=Phaos Technology,L=New York,ST=New York,C=US1000001CN=Test Client (RSA),OU=Engineering,O=Phaos Technology,L=New York,ST=New York,C=USE+fKwQsT5lS3mWmBkalUTp0JRW8="; + + + [Test] + public void KeepDocument () + { + string result = @"nDF2V/bzRd0VE3EwShWtsBzTEDc="; + + XmlDocument doc = new XmlDocument (); + doc.LoadXml (xml); + XmlElement org = (XmlElement) doc.SelectSingleNode ("//*[local-name()='Reference']"); + Reference r = new Reference (); + r.LoadXml (org); + XmlElement el = r.GetXml (); + AssertEquals (doc, el.OwnerDocument); + AssertEquals (org, el); + AssertEquals (result, el.OuterXml); + } } }