e652a6cd2f078e67d179dba083b7d67a0f40e7a5
[mono.git] / mcs / class / System.Web.Services / Test / System.Web.Services.Description / ServiceDescriptionCollectionTest.cs
1 //
2 // MonoTests.System.Web.Services.Description.ServiceDescriptionCollectionTest.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 ServiceDescriptionCollectionTest
19         {
20                 ServiceDescriptionCollection sdc;
21
22                 [SetUp]
23                 public void InitializeServiceDescriptionCollection ()
24                 {
25                         sdc = new ServiceDescriptionCollection ();
26                 }
27
28                 [Test]
29                 public void TestDefaultProperties()
30                 {
31                         Assertion.AssertNull (sdc["hello"]);
32                         Assertion.AssertEquals (0, sdc.Count);
33                 }
34                 
35                 [Test]
36                 public void TestAddServiceDescriptionWithoutTargetNS ()
37                 {
38                         const string serviceDescriptionNamespace = "testServiceDescription";
39                         
40                         ServiceDescription sd = new ServiceDescription ();      
41                         sdc.Add (sd);
42
43                         Assertion.AssertEquals (1, sdc.Count);
44                         Assertion.AssertNull (sdc[serviceDescriptionNamespace]);
45                 }
46
47                 [Test]
48                 public void TestAddServiceDescriptionWithTargetNS ()
49                 {
50                         const string serviceDescriptionNamespace = "http://some.urn";
51                         
52                         ServiceDescription sd = new ServiceDescription ();
53                         sd.TargetNamespace = serviceDescriptionNamespace;
54                         
55                         sdc.Add (sd);
56
57                         Assertion.AssertEquals (1, sdc.Count);
58                         Assertion.AssertEquals (sd, sdc[serviceDescriptionNamespace]);
59                 }
60         }
61 }