2007-05-08 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / System.Web.Services / Test / System.Web.Services.Description / ServiceDescriptionFormatExtensionCollectionTest.cs
1 //
2 // ServiceDescriptionFormatExtensionCollectionTest.cs
3 //
4 // Author:
5 //      Atsushi Enomoto  <atsushi@ximian.com>
6 //
7 // (C) 2006 Novell, Inc.
8 //
9
10 using NUnit.Framework;
11
12 using System;
13 using System.Web.Services.Description;
14 using System.Xml;
15
16 namespace MonoTests.System.Web.Services.Description
17 {
18         [TestFixture]
19         public class ServiceDescriptionFormatExtensionCollectionTest
20         {
21                 [Test]
22                 [ExpectedException (typeof (ArgumentException))]
23                 public void Add ()
24                 {
25                         ServiceDescriptionFormatExtensionCollection c =
26                                 new ServiceDescriptionFormatExtensionCollection (new ServiceDescription ());
27
28                         c.Add (0);
29                 }
30
31                 [Test]
32                 public void Add2 ()
33                 {
34                         ServiceDescriptionFormatExtensionCollection c =
35                                 new ServiceDescriptionFormatExtensionCollection (new ServiceDescription ());
36
37                         c.Add (new XmlDocument ().CreateElement ("foo"));
38                 }
39
40                 class MySoapBinding : SoapBinding
41                 {
42                 }
43
44                 [Test]
45                 public void Find ()
46                 {
47                         ServiceDescriptionFormatExtensionCollection c =
48                                 new ServiceDescriptionFormatExtensionCollection (new ServiceDescription ());
49                         c.Add (new MySoapBinding ());
50                         Assert.IsNotNull (c.Find (typeof (SoapBinding)));
51                 }
52         }
53 }