2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / System.Web.Services / Test / System.Web.Services.Description / ServiceCollectionTest.cs
1 //
2 // MonoTests.System.Web.Services.Description.ServiceCollectionTest.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 ServiceCollectionTest
19         {
20                 ServiceCollection sc;
21
22                 [SetUp]
23                 public void InitializeServiceCollection ()
24                 {
25                         // workaround for internal constructor
26                         ServiceDescription desc = new ServiceDescription ();
27                         sc = desc.Services;
28                 }
29
30                 [Test]
31                 public void TestDefaultProperties()
32                 {
33                         Assertion.AssertNull (sc["hello"]);
34                         Assertion.AssertEquals (0, sc.Count);
35                 }
36                 
37                 [Test]
38                 public void TestAddService ()
39                 {
40                         const string serviceName = "testService";
41                         
42                         Service s = new Service ();
43                         s.Name = serviceName;
44                         
45                         sc.Add (s);
46
47                         Assertion.AssertEquals (1, sc.Count);
48                         Assertion.AssertEquals (s, sc[serviceName]);
49                 }
50         }
51 }