* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / System.XML / Test / System.Xml.Serialization / SoapAttributesTests.cs
1 //
2 // System.Xml.XmlAttributesTests
3 //
4 // Author:
5 //   Gert Driesen
6 //
7 // (C) 2006 Novell
8 //
9
10 using System;
11 using System.Xml.Serialization;
12
13 using NUnit.Framework;
14
15 using MonoTests.System.Xml.TestClasses;
16
17 namespace MonoTests.System.XmlSerialization
18 {
19         [TestFixture]
20         public class SoapAttributesTests
21         {
22                 [Test]
23 #if NET_2_0
24                 // in .NET 2.0, SoapDefaultValue should be null by default, but we need
25                 // more tests before making this change
26                 [Category ("NotDotNet")]
27 #endif
28                 public void Defaults ()
29                 {
30                         SoapAttributes atts = new SoapAttributes ();
31                         Assert.IsNull (atts.SoapAttribute, "#1");
32                         Assert.IsNotNull (atts.SoapDefaultValue, "#2");
33                         Assert.AreEqual (DBNull.Value, atts.SoapDefaultValue, "#3");
34                         Assert.IsNull (atts.SoapElement, "#4");
35                         Assert.IsNull (atts.SoapEnum, "#5");
36                         Assert.AreEqual (false, atts.SoapIgnore, "#6");
37                         Assert.IsNull (atts.SoapType, "#7");
38                 }
39
40                 [Test]
41                 public void SoapType ()
42                 {
43                         SoapAttributes atts = new SoapAttributes (typeof (TestDefault));
44                         Assert.IsNotNull (atts.SoapType, "#1");
45                         Assert.AreEqual ("testDefault", atts.SoapType.TypeName, "#2");
46                         Assert.AreEqual ("urn:myNS", atts.SoapType.Namespace, "#3");
47                 }
48
49                 [Test]
50                 public void SoapDefaultValue ()
51                 {
52                         SoapAttributes atts = new SoapAttributes (typeof (TestDefault).GetMember("strDefault")[0]);
53                         Assert.IsNotNull (atts.SoapDefaultValue, "#1");
54                         Assert.AreEqual ("Default Value", atts.SoapDefaultValue, "#2");
55                 }
56
57                 [Test]
58                 public void SoapEnum ()
59                 {
60                         SoapAttributes atts = new SoapAttributes (typeof (FlagEnum_Encoded).GetMember("e1")[0]);
61                         Assert.IsNotNull (atts.SoapEnum, "#1");
62                         Assert.AreEqual ("one", atts.SoapEnum.Name, "#2");
63                 }
64         }
65 }