2009-06-26 Robert Jordan <robertj@gmx.net>
[mono.git] / mcs / class / System.Web.Services / Test / System.Web.Services.Description / PortTypeCollectionTest.cs
1 //
2 // MonoTests.System.Web.Services.Description.PortTypeCollectionTest.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 PortTypeCollectionTest
19         {
20                 PortTypeCollection ptc;
21
22                 [SetUp]
23                 public void InitializePortTypeCollection ()
24                 {
25                         // workaround for internal constructor
26                         ServiceDescription desc = new ServiceDescription ();
27                         ptc = desc.PortTypes;
28                 }
29
30                 [Test]
31                 public void TestDefaultProperties()
32                 {
33                         Assert.IsNull (ptc["hello"]);
34                         Assert.AreEqual (0, ptc.Count);
35                 }
36                 
37                 [Test]
38                 public void TestAddPortType ()
39                 {
40                         const string portTypeName = "testPortType";
41                         
42                         PortType p = new PortType ();
43                         p.Name = portTypeName;
44                         
45                         ptc.Add (p);
46
47                         Assert.AreEqual (1, ptc.Count);
48                         Assert.AreEqual (p, ptc[portTypeName]);
49                 }
50         }
51 }