Files
mono/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlLicenseTransformTest.cs
T
Gert Driesen 19098dd864 * XmlDsigXsltTranformTest.cs: Added test for .ctor (bool).
* XmlDsigEnvelopedTransformTest.cs: Added test for .ctor (bool). Use
Assert class. Improved properties tests.
* XmlDsigC14TransformTest.cs: Added test for .ctor (bool).
* XmlDsigExcC14NTransformTest.cs: Added .ctor tests and added asserts
IncludsiveNamespacesPrefixList
* XmlDsigExcC14NWithCommentsTransformTest.cs: Added basic .ctor and
properties tests.
* XmlDsigC14NWithCommentsTransformTest.cs: Fixed line endings.
* XmlLicenseTransformTest.cs: Added basic .ctor and properties tests.
* XmlDsigBase64Transform.cs: Use constant for Algorithm namespace.
* XmlDsigExcC14NTransform.cs: Fixed ctors to use WithComments
algorithm if includeComments is true. Assign includeNamespacesPrefixList
to instance field.
* XmlDsigExcC14NWithCommentsTransform.cs: Remove unnecessary
assignment to Algorithm now that base ctor is fixed.
* XmlDsigC14NWithCommentsTransform.cs: Remove unnecessary assignment
to Algorithm now that base ctor is fixed.
* XmlDsigC14NTransform.cs: In default ctor, just invoke .ctor (bool).
In .ctor (bool), assign WithComments algorithm if includeComments is
true. Use constants for Algorithm namespace.
* XmlDsigEnvelopedSignatureTransform.cs: Use constant for Algorithm
namespace.
* XmlDsigXPathTransform.cs: Use constant for Algorithm namespace.
* XmlDsigXsltTransform.cs: Use constant for Algorithm namespace.
* XmlLicenseTransform.cs: Assign Algorithm in ctor.
* XmlSignature.cs: Added constant for XmlLicenseTransform algorithm.
* System.Security_test.dll.sources: Added XmlLicenseTransformTest.cs
and XmlDsigExcC14NWithCommentsTransformTest.cs.

svn path=/trunk/mcs/; revision=115803
2008-10-14 18:33:13 +00:00

94 lines
2.2 KiB
C#

//
// XmlLicenseTransformTest.cs - NUnit Test Cases for XmlLicenseTransform
//
// Author:
// original:
// Sebastien Pouliot <[email protected]>
// Aleksey Sanin ([email protected])
// this file:
// Gert Driesen <[email protected]>
//
// (C) 2003 Aleksey Sanin ([email protected])
// (C) 2004 Novell (http://www.novell.com)
// (C) 2008 Gert Driesen
//
#if NET_2_0
using System;
using System.IO;
using System.Security.Cryptography.Xml;
using System.Text;
using System.Xml;
using NUnit.Framework;
namespace MonoTests.System.Security.Cryptography.Xml {
public class UnprotectedXmlLicenseTransform : XmlLicenseTransform {
public XmlNodeList UnprotectedGetInnerXml ()
{
return base.GetInnerXml ();
}
}
[TestFixture]
public class XmlLicenseTransformTest {
private UnprotectedXmlLicenseTransform transform;
[SetUp]
public void SetUp ()
{
transform = new UnprotectedXmlLicenseTransform ();
}
[Test] // ctor ()
public void Constructor1 ()
{
Assert.AreEqual ("urn:mpeg:mpeg21:2003:01-REL-R-NS:licenseTransform",
transform.Algorithm, "Algorithm");
Assert.IsNull (transform.Decryptor, "Decryptor");
Type[] input = transform.InputTypes;
Assert.AreEqual (1, input.Length, "Input #");
Assert.AreEqual (typeof (XmlDocument), input [0], "Input Type");
Type[] output = transform.OutputTypes;
Assert.AreEqual (1, output.Length, "Output #");
Assert.AreEqual (typeof (XmlDocument), output [0], "Output Type");
}
[Test]
public void InputTypes ()
{
// property does not return a clone
transform.InputTypes [0] = null;
Assert.IsNull (transform.InputTypes [0]);
// it's not a static array
transform = new UnprotectedXmlLicenseTransform ();
Assert.IsNotNull (transform.InputTypes [0]);
}
[Test]
public void GetInnerXml ()
{
XmlNodeList xnl = transform.UnprotectedGetInnerXml ();
Assert.IsNull (xnl, "Default InnerXml");
}
[Test]
public void OutputTypes ()
{
// property does not return a clone
transform.OutputTypes [0] = null;
Assert.IsNull (transform.OutputTypes [0], "#1");
// it's not a static array
transform = new UnprotectedXmlLicenseTransform ();
Assert.IsNotNull (transform.OutputTypes [0], "#2");
}
}
}
#endif