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
19 using System.Security.Cryptography.Xml;
23 using NUnit.Framework;
25 namespace MonoTests.System.Security.Cryptography.Xml {
26 public class UnprotectedXmlLicenseTransform : XmlLicenseTransform {
27 public XmlNodeList UnprotectedGetInnerXml ()
29 return base.GetInnerXml ();
34 public class XmlLicenseTransformTest {
35 private UnprotectedXmlLicenseTransform transform;
40 transform = new UnprotectedXmlLicenseTransform ();
44 public void Constructor1 ()
46 Assert.AreEqual ("urn:mpeg:mpeg21:2003:01-REL-R-NS:licenseTransform",
47 transform.Algorithm, "Algorithm");
48 Assert.IsNull (transform.Decryptor, "Decryptor");
50 Type[] input = transform.InputTypes;
51 Assert.AreEqual (1, input.Length, "Input #");
52 Assert.AreEqual (typeof (XmlDocument), input [0], "Input Type");
54 Type[] output = transform.OutputTypes;
55 Assert.AreEqual (1, output.Length, "Output #");
56 Assert.AreEqual (typeof (XmlDocument), output [0], "Output Type");
60 public void InputTypes ()
62 // property does not return a clone
63 transform.InputTypes [0] = null;
64 Assert.IsNull (transform.InputTypes [0]);
66 // it's not a static array
67 transform = new UnprotectedXmlLicenseTransform ();
68 Assert.IsNotNull (transform.InputTypes [0]);
72 public void GetInnerXml ()
74 XmlNodeList xnl = transform.UnprotectedGetInnerXml ();
75 Assert.IsNull (xnl, "Default InnerXml");
79 public void OutputTypes ()
81 // property does not return a clone
82 transform.OutputTypes [0] = null;
83 Assert.IsNull (transform.OutputTypes [0], "#1");
85 // it's not a static array
86 transform = new UnprotectedXmlLicenseTransform ();
87 Assert.IsNotNull (transform.OutputTypes [0], "#2");