Operation interface methods also have ServiceKnownType attributes.
[mono.git] / mcs / class / System.Web.Abstractions / Test / System.Web / HttpApplicationStateBaseTest.cs
1 //
2 // HttpApplicationStateBaseTest.cs
3 //
4 // Author:
5 //      Atsushi Enomoto <atsushi@ximian.com>
6 //
7 // Copyright (C) 2008 Novell Inc. http://novell.com
8 //
9
10 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 // 
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 // 
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30
31 using System;
32 using System.Web;
33 using NUnit.Framework;
34
35 namespace MonoTests.System.Web
36 {
37         class HttpApplicationStateImpl : HttpApplicationStateBase
38         {
39         }
40
41         [TestFixture]
42         public class HttpApplicationStateBaseTest
43         {
44                 [Test]
45                 public void DefaultImplementation ()
46                 {
47                         var i = new HttpApplicationStateImpl ();
48                         object x;
49                         try {
50                                 x = i.AllKeys;
51                                 Assert.Fail ("#1");
52                         } catch (NotImplementedException) {
53                         }
54                         try {
55                                 x = i.Contents;
56                                 Assert.Fail ("#2");
57                         } catch (NotImplementedException) {
58                         }
59                         try {
60                                 x = i.Count;
61                                 Assert.Fail ("#3");
62                         } catch (NotImplementedException) {
63                         }
64                         try {
65                                 x = i.IsSynchronized;
66                                 Assert.Fail ("#4");
67                         } catch (NotImplementedException) {
68                         }
69                         try {
70                                 x = i.StaticObjects;
71                                 Assert.Fail ("#5");
72                         } catch (NotImplementedException) {
73                         }
74                         try {
75                                 x = i.SyncRoot;
76                                 Assert.Fail ("#6");
77                         } catch (NotImplementedException) {
78                         }
79
80                         try {
81                                 i.Add (null, null);
82                                 Assert.Fail ("#7");
83                         } catch (NotImplementedException) {
84                         }
85                         try {
86                                 i.Clear ();
87                                 Assert.Fail ("#8");
88                         } catch (NotImplementedException) {
89                         }
90                         try {
91                                 i.CopyTo (null, 0);
92                                 Assert.Fail ("#9");
93                         } catch (NotImplementedException) {
94                         }
95                         try {
96                                 i.Get (null);
97                                 Assert.Fail ("#10");
98                         } catch (NotImplementedException) {
99                         }
100                         try {
101                                 i.GetEnumerator ();
102                                 Assert.Fail ("#11");
103                         } catch (NotImplementedException) {
104                         }
105
106                         // ... so, default implementation is basically NIE.
107                 }
108         }
109 }