Merge pull request #3715 from kumpera/fix-44707
[mono.git] / mcs / class / System.Windows.Forms / Test / System.Resources / HelperClasses_ITRS.cs
1 //
2 // HelperClasses_ITRS.cs : Various ITypeResolutionService implementations 
3 // for use during testing.
4 // 
5 // Author:
6 //      Gary Barnett (gary.barnett.mono@gmail.com)
7 // 
8 // Copyright (C) Gary Barnett (2012)
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining
11 // a copy of this software and associated documentation files (the
12 // "Software"), to deal in the Software without restriction, including
13 // without limitation the rights to use, copy, modify, merge, publish,
14 // distribute, sublicense, and/or sell copies of the Software, and to
15 // permit persons to whom the Software is furnished to do so, subject to
16 // the following conditions:
17 // 
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
20 // 
21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
29 using System;
30 using System.ComponentModel.Design;
31 using System.Reflection;
32
33 namespace MonoTests.System.Resources {
34         public class DummyITRS : ITypeResolutionService {
35                 public Assembly GetAssembly (AssemblyName name, bool throwOnError)
36                 {
37                         return null;
38                 }
39
40                 public Assembly GetAssembly (AssemblyName name)
41                 {
42                         return null;
43                 }
44
45                 public string GetPathOfAssembly (AssemblyName name)
46                 {
47                         return null;
48                 }
49
50                 public Type GetType (string name, bool throwOnError, bool ignoreCase)
51                 {
52                         return null;
53                 }
54
55                 public Type GetType (string name, bool throwOnError)
56                 {
57                         return null;
58                 }
59
60                 public Type GetType (string name)
61                 {
62                         return null;
63                 }
64
65                 public void ReferenceAssembly (AssemblyName name)
66                 {
67
68                 }
69         }
70
71         public class ReturnSerializableSubClassITRS : ITypeResolutionService {
72                 public Assembly GetAssembly (AssemblyName name, bool throwOnError)
73                 {
74                         throw new NotImplementedException ("I was accessed");
75                 }
76
77                 public Assembly GetAssembly (AssemblyName name)
78                 {
79                         throw new NotImplementedException ("I was accessed");
80                 }
81
82                 public string GetPathOfAssembly (AssemblyName name)
83                 {
84                         throw new NotImplementedException ("I was accessed");
85                 }
86
87                 public Type GetType (string name, bool throwOnError, bool ignoreCase)
88                 {
89                         return typeof (serializableSubClass);
90                 }
91
92                 public Type GetType (string name, bool throwOnError)
93                 {
94                         return typeof (serializableSubClass);
95                 }
96
97                 public Type GetType (string name)
98                 {
99                         return typeof (serializableSubClass);
100                 }
101
102                 public void ReferenceAssembly (AssemblyName name)
103                 {
104
105                 }
106
107         }
108
109         public class ReturnIntITRS : ITypeResolutionService {
110                 public Assembly GetAssembly (AssemblyName name, bool throwOnError)
111                 {
112                         throw new NotImplementedException ("I was accessed");
113                 }
114
115                 public Assembly GetAssembly (AssemblyName name)
116                 {
117                         throw new NotImplementedException ("I was accessed");
118                 }
119
120                 public string GetPathOfAssembly (AssemblyName name)
121                 {
122                         throw new NotImplementedException ("I was accessed");
123                 }
124
125                 public Type GetType (string name, bool throwOnError, bool ignoreCase)
126                 {
127                         return typeof (Int32);
128                 }
129
130                 public Type GetType (string name, bool throwOnError)
131                 {
132                         return typeof (Int32);
133                 }
134
135                 public Type GetType (string name)
136                 {
137                         return typeof (Int32);
138                 }
139
140                 public void ReferenceAssembly (AssemblyName name)
141                 {
142
143                 }
144         }
145
146         public class ExceptionalITRS : ITypeResolutionService {
147                 public Assembly GetAssembly (AssemblyName name, bool throwOnError)
148                 {
149                         throw new NotImplementedException ("I was accessed");
150                 }
151
152                 public Assembly GetAssembly (AssemblyName name)
153                 {
154                         throw new NotImplementedException ("I was accessed");
155                 }
156
157                 public string GetPathOfAssembly (AssemblyName name)
158                 {
159                         throw new NotImplementedException ("I was accessed");
160                 }
161
162                 public Type GetType (string name, bool throwOnError, bool ignoreCase)
163                 {
164                         throw new NotImplementedException ("I was accessed");
165                 }
166
167                 public Type GetType (string name, bool throwOnError)
168                 {
169                         throw new NotImplementedException ("I was accessed");
170                 }
171
172                 public Type GetType (string name)
173                 {
174                         throw new NotImplementedException ("I was accessed");
175                 }
176
177                 public void ReferenceAssembly (AssemblyName name)
178                 {
179
180                 }
181         }
182
183 }