2 // System.Xml.XmlAttributesTests
11 using System.Xml.Serialization;
13 using NUnit.Framework;
15 using MonoTests.System.Xml.TestClasses;
17 namespace MonoTests.System.XmlSerialization
20 public class SoapAttributesTests
24 // in .NET 2.0, SoapDefaultValue should be null by default, but we need
25 // more tests before making this change
26 [Category ("NotDotNet")]
28 public void Defaults ()
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");
41 public void SoapType ()
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");
50 public void SoapDefaultValue ()
52 SoapAttributes atts = new SoapAttributes (typeof (TestDefault).GetMember("strDefault")[0]);
53 Assert.IsNotNull (atts.SoapDefaultValue, "#1");
54 Assert.AreEqual ("Default Value", atts.SoapDefaultValue, "#2");
58 public void SoapEnum ()
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");