2009-06-26 Robert Jordan <robertj@gmx.net>
[mono.git] / mcs / class / System.Web.Services / Test / System.Web.Services.Description / OperationCollectionTest.cs
1 //
2 // MonoTests.System.Web.Services.Description.OperationCollectionTest.cs
3 //
4 // Author:
5 //   Erik LeBel <eriklebel@yahoo.ca>
6 //
7 // (C) 2003 Erik LeBel
8 //
9
10 using NUnit.Framework;
11
12 using System;
13 using System.Web.Services.Description;
14
15 namespace MonoTests.System.Web.Services.Description
16 {
17         [TestFixture]
18         public class OperationCollectionTest
19         {
20                 OperationCollection operations;
21
22                 [SetUp]
23                 public void InitializeOperations()
24                 {
25                         // workaround for internal constructor
26                         PortType portType = new PortType();
27                         operations = portType.Operations;
28                 }
29
30                 [Test]
31                 public void TestDefaultProperties()
32                 {
33                         Assert.AreEqual (0, operations.Count);
34                 }
35
36                 [Test]
37                 [ExpectedException (typeof (ArgumentNullException))]
38                 public void TestAddNullObject()
39                 {
40                         operations.Add(null);
41                 }
42
43                 [Test]
44                 public void TestAddValidOperation()
45                 {
46                         operations.Add(new Operation());        
47                         Assert.AreEqual (1, operations.Count);
48                 }
49         }
50 }