SoapAttributesTests.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // System.Xml.XmlAttributesTests
  3. //
  4. // Author:
  5. // Gert Driesen
  6. //
  7. // (C) 2006 Novell
  8. //
  9. using System;
  10. using System.Xml.Serialization;
  11. using NUnit.Framework;
  12. using MonoTests.System.Xml.TestClasses;
  13. namespace MonoTests.System.XmlSerialization
  14. {
  15. [TestFixture]
  16. public class SoapAttributesTests
  17. {
  18. [Test]
  19. public void Defaults ()
  20. {
  21. SoapAttributes atts = new SoapAttributes ();
  22. Assert.IsNull (atts.SoapAttribute, "#1");
  23. Assert.IsNull (atts.SoapDefaultValue, "#2");
  24. Assert.IsNull (atts.SoapElement, "#4");
  25. Assert.IsNull (atts.SoapEnum, "#5");
  26. Assert.AreEqual (false, atts.SoapIgnore, "#6");
  27. Assert.IsNull (atts.SoapType, "#7");
  28. }
  29. [Test]
  30. public void SoapType ()
  31. {
  32. SoapAttributes atts = new SoapAttributes (typeof (TestDefault));
  33. Assert.IsNotNull (atts.SoapType, "#1");
  34. Assert.AreEqual ("testDefault", atts.SoapType.TypeName, "#2");
  35. Assert.AreEqual ("urn:myNS", atts.SoapType.Namespace, "#3");
  36. }
  37. [Test]
  38. public void SoapDefaultValue ()
  39. {
  40. SoapAttributes atts = new SoapAttributes (typeof (TestDefault).GetMember("strDefault")[0]);
  41. Assert.IsNotNull (atts.SoapDefaultValue, "#1");
  42. Assert.AreEqual ("Default Value", atts.SoapDefaultValue, "#2");
  43. }
  44. [Test]
  45. public void SoapEnum ()
  46. {
  47. SoapAttributes atts = new SoapAttributes (typeof (FlagEnum_Encoded).GetMember("e1")[0]);
  48. Assert.IsNotNull (atts.SoapEnum, "#1");
  49. Assert.AreEqual ("one", atts.SoapEnum.Name, "#2");
  50. }
  51. }
  52. }