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