XmlElementAttributeTests.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //
  2. // Tests for System.Xml.Serialization.XmlElementAttribute
  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 XmlElementAttributeTests
  16. {
  17. [Test]
  18. public void DataTypeDefault ()
  19. {
  20. XmlElementAttribute attr = new XmlElementAttribute ();
  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. XmlElementAttribute attr = new XmlElementAttribute ();
  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. XmlElementAttribute attr = new XmlElementAttribute ();
  37. Assert.AreEqual (XmlSchemaForm.None, attr.Form);
  38. }
  39. [Test]
  40. public void IsNullableDefault ()
  41. {
  42. XmlElementAttribute attr = new XmlElementAttribute ();
  43. Assert.AreEqual (false, attr.IsNullable);
  44. }
  45. [Test]
  46. public void NamespaceDefault ()
  47. {
  48. XmlElementAttribute attr = new XmlElementAttribute ();
  49. Assert.IsNull (attr.Namespace);
  50. }
  51. [Test]
  52. public void TypeDefault ()
  53. {
  54. XmlElementAttribute attr = new XmlElementAttribute ();
  55. Assert.IsNull (attr.Type);
  56. }
  57. }
  58. }