XmlArrayItemAttributeTests.cs 1.6 KB

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