2 // XmlLicenseTransformTest.cs - NUnit Test Cases for XmlLicenseTransform
6 // Sebastien Pouliot <sebastien@ximian.com>
7 // Aleksey Sanin (aleksey@aleksey.com)
9 // Gert Driesen <drieseng@users.sourceforge.net>
11 // (C) 2003 Aleksey Sanin (aleksey@aleksey.com)
12 // (C) 2004 Novell (http://www.novell.com)
13 // (C) 2008 Gert Driesen
20 using System.Security.Cryptography.Xml;
24 using NUnit.Framework;
26 namespace MonoTests.System.Security.Cryptography.Xml {
27 public class UnprotectedXmlLicenseTransform : XmlLicenseTransform {
28 public XmlNodeList UnprotectedGetInnerXml ()
30 return base.GetInnerXml ();
35 public class XmlLicenseTransformTest {
36 private UnprotectedXmlLicenseTransform transform;
41 transform = new UnprotectedXmlLicenseTransform ();
45 public void Constructor1 ()
47 Assert.AreEqual ("urn:mpeg:mpeg21:2003:01-REL-R-NS:licenseTransform",
48 transform.Algorithm, "Algorithm");
49 Assert.IsNull (transform.Decryptor, "Decryptor");
51 Type[] input = transform.InputTypes;
52 Assert.AreEqual (1, input.Length, "Input #");
53 Assert.AreEqual (typeof (XmlDocument), input [0], "Input Type");
55 Type[] output = transform.OutputTypes;
56 Assert.AreEqual (1, output.Length, "Output #");
57 Assert.AreEqual (typeof (XmlDocument), output [0], "Output Type");
61 public void InputTypes ()
63 // property does not return a clone
64 transform.InputTypes [0] = null;
65 Assert.IsNull (transform.InputTypes [0]);
67 // it's not a static array
68 transform = new UnprotectedXmlLicenseTransform ();
69 Assert.IsNotNull (transform.InputTypes [0]);
73 public void GetInnerXml ()
75 XmlNodeList xnl = transform.UnprotectedGetInnerXml ();
76 Assert.IsNull (xnl, "Default InnerXml");
80 public void OutputTypes ()
82 // property does not return a clone
83 transform.OutputTypes [0] = null;
84 Assert.IsNull (transform.OutputTypes [0], "#1");
86 // it's not a static array
87 transform = new UnprotectedXmlLicenseTransform ();
88 Assert.IsNotNull (transform.OutputTypes [0], "#2");