OperationCollectionTest.cs 934 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // MonoTests.System.Web.Services.Description.OperationCollectionTest.cs
  3. //
  4. // Author:
  5. // Erik LeBel <[email protected]>
  6. //
  7. // (C) 2003 Erik LeBel
  8. //
  9. using NUnit.Framework;
  10. using System;
  11. using System.Web.Services.Description;
  12. namespace MonoTests.System.Web.Services.Description
  13. {
  14. [TestFixture]
  15. public class OperationCollectionTest
  16. {
  17. OperationCollection operations;
  18. [SetUp]
  19. public void InitializeOperations()
  20. {
  21. // workaround for internal constructor
  22. PortType portType = new PortType();
  23. operations = portType.Operations;
  24. }
  25. [Test]
  26. public void TestDefaultProperties()
  27. {
  28. Assertion.AssertEquals(0, operations.Count);
  29. }
  30. [Test]
  31. [ExpectedException (typeof (ArgumentNullException))]
  32. public void TestAddNullObject()
  33. {
  34. operations.Add(null);
  35. }
  36. [Test]
  37. public void TestAddValidOperation()
  38. {
  39. operations.Add(new Operation());
  40. Assertion.AssertEquals(1, operations.Count);
  41. }
  42. }
  43. }