[bcl] Remove more NET_2_0 checks from class libs
[mono.git] / mcs / class / System.Security / Test / System.Security.Cryptography.Xml / XmlLicenseTransformTest.cs
1 //
2 // XmlLicenseTransformTest.cs - NUnit Test Cases for XmlLicenseTransform
3 //
4 // Author:
5 //  original:
6 //      Sebastien Pouliot <sebastien@ximian.com>
7 //      Aleksey Sanin (aleksey@aleksey.com)
8 //  this file:
9 //      Gert Driesen <drieseng@users.sourceforge.net>
10 //
11 // (C) 2003 Aleksey Sanin (aleksey@aleksey.com)
12 // (C) 2004 Novell (http://www.novell.com)
13 // (C) 2008 Gert Driesen
14 //
15
16
17 using System;
18 using System.IO;
19 using System.Security.Cryptography.Xml;
20 using System.Text;
21 using System.Xml;
22
23 using NUnit.Framework;
24
25 namespace MonoTests.System.Security.Cryptography.Xml {
26         public class UnprotectedXmlLicenseTransform : XmlLicenseTransform {
27                 public XmlNodeList UnprotectedGetInnerXml ()
28                 {
29                         return base.GetInnerXml ();
30                 }
31         }
32
33         [TestFixture]
34         public class XmlLicenseTransformTest {
35                 private UnprotectedXmlLicenseTransform transform;
36
37                 [SetUp]
38                 public void SetUp ()
39                 {
40                         transform = new UnprotectedXmlLicenseTransform ();
41                 }
42
43                 [Test] // ctor ()
44                 public void Constructor1 ()
45                 {
46                         Assert.AreEqual ("urn:mpeg:mpeg21:2003:01-REL-R-NS:licenseTransform",
47                                 transform.Algorithm, "Algorithm");
48                         Assert.IsNull (transform.Decryptor, "Decryptor");
49
50                         Type[] input = transform.InputTypes;
51                         Assert.AreEqual (1, input.Length, "Input #");
52                         Assert.AreEqual (typeof (XmlDocument), input [0], "Input Type");
53
54                         Type[] output = transform.OutputTypes;
55                         Assert.AreEqual (1, output.Length, "Output #");
56                         Assert.AreEqual (typeof (XmlDocument), output [0], "Output Type");
57                 }
58
59                 [Test]
60                 public void InputTypes ()
61                 {
62                         // property does not return a clone
63                         transform.InputTypes [0] = null;
64                         Assert.IsNull (transform.InputTypes [0]);
65
66                         // it's not a static array
67                         transform = new UnprotectedXmlLicenseTransform ();
68                         Assert.IsNotNull (transform.InputTypes [0]);
69                 }
70
71                 [Test]
72                 public void GetInnerXml ()
73                 {
74                         XmlNodeList xnl = transform.UnprotectedGetInnerXml ();
75                         Assert.IsNull (xnl, "Default InnerXml");
76                 }
77
78                 [Test]
79                 public void OutputTypes ()
80                 {
81                         // property does not return a clone
82                         transform.OutputTypes [0] = null;
83                         Assert.IsNull (transform.OutputTypes [0], "#1");
84
85                         // it's not a static array
86                         transform = new UnprotectedXmlLicenseTransform ();
87                         Assert.IsNotNull (transform.OutputTypes [0], "#2");
88                 }
89         }
90 }
91