Merge pull request #496 from nicolas-raoul/unit-test-for-issue2907
[mono.git] / mcs / class / System.XML / Test / System.Xml.Serialization / XmlElementAttributeTests.cs
1 //
2 // Tests for System.Xml.Serialization.XmlElementAttribute
3 //
4 // Author:
5 //   Gert Driesen
6 //
7 // (C) 2005 Novell
8 //
9
10 using System.Xml.Schema;
11 using System.Xml.Serialization;
12
13 using NUnit.Framework;
14
15 namespace MonoTests.System.XmlSerialization
16 {
17         [TestFixture]
18         public class XmlElementAttributeTests
19         {
20                 [Test]
21                 public void DataTypeDefault ()
22                 {
23                         XmlElementAttribute attr = new XmlElementAttribute ();
24                         Assert.AreEqual (string.Empty, attr.DataType, "#1");
25
26                         attr.DataType = null;
27                         Assert.AreEqual (string.Empty, attr.DataType, "#2");
28                 }
29
30                 [Test]
31                 public void ElementNameDefault ()
32                 {
33                         XmlElementAttribute attr = new XmlElementAttribute ();
34                         Assert.AreEqual (string.Empty, attr.ElementName, "#1");
35
36                         attr.ElementName = null;
37                         Assert.AreEqual (string.Empty, attr.ElementName, "#2");
38                 }
39
40                 [Test]
41                 public void FormDefault ()
42                 {
43                         XmlElementAttribute attr = new XmlElementAttribute ();
44                         Assert.AreEqual (XmlSchemaForm.None, attr.Form);
45                 }
46
47                 [Test]
48                 public void IsNullableDefault ()
49                 {
50                         XmlElementAttribute attr = new XmlElementAttribute ();
51                         Assert.AreEqual (false, attr.IsNullable);
52                 }
53
54                 [Test]
55                 public void NamespaceDefault ()
56                 {
57                         XmlElementAttribute attr = new XmlElementAttribute ();
58                         Assert.IsNull (attr.Namespace);
59                 }
60
61                 [Test]
62                 public void TypeDefault ()
63                 {
64                         XmlElementAttribute attr = new XmlElementAttribute ();
65                         Assert.IsNull (attr.Type);
66                 }
67         }
68 }