2 // HelperClasses_ITRS.cs : Various ITypeResolutionService implementations
3 // for use during testing.
6 // Gary Barnett (gary.barnett.mono@gmail.com)
8 // Copyright (C) Gary Barnett (2012)
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:
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
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.
30 using System.ComponentModel.Design;
31 using System.Reflection;
33 namespace MonoTests.System.Resources {
34 public class DummyITRS : ITypeResolutionService {
35 public Assembly GetAssembly (AssemblyName name, bool throwOnError)
40 public Assembly GetAssembly (AssemblyName name)
45 public string GetPathOfAssembly (AssemblyName name)
50 public Type GetType (string name, bool throwOnError, bool ignoreCase)
55 public Type GetType (string name, bool throwOnError)
60 public Type GetType (string name)
65 public void ReferenceAssembly (AssemblyName name)
71 public class ReturnSerializableSubClassITRS : ITypeResolutionService {
72 public Assembly GetAssembly (AssemblyName name, bool throwOnError)
74 throw new NotImplementedException ("I was accessed");
77 public Assembly GetAssembly (AssemblyName name)
79 throw new NotImplementedException ("I was accessed");
82 public string GetPathOfAssembly (AssemblyName name)
84 throw new NotImplementedException ("I was accessed");
87 public Type GetType (string name, bool throwOnError, bool ignoreCase)
89 return typeof (serializableSubClass);
92 public Type GetType (string name, bool throwOnError)
94 return typeof (serializableSubClass);
97 public Type GetType (string name)
99 return typeof (serializableSubClass);
102 public void ReferenceAssembly (AssemblyName name)
109 public class ReturnIntITRS : ITypeResolutionService {
110 public Assembly GetAssembly (AssemblyName name, bool throwOnError)
112 throw new NotImplementedException ("I was accessed");
115 public Assembly GetAssembly (AssemblyName name)
117 throw new NotImplementedException ("I was accessed");
120 public string GetPathOfAssembly (AssemblyName name)
122 throw new NotImplementedException ("I was accessed");
125 public Type GetType (string name, bool throwOnError, bool ignoreCase)
127 return typeof (Int32);
130 public Type GetType (string name, bool throwOnError)
132 return typeof (Int32);
135 public Type GetType (string name)
137 return typeof (Int32);
140 public void ReferenceAssembly (AssemblyName name)
146 public class ExceptionalITRS : ITypeResolutionService {
147 public Assembly GetAssembly (AssemblyName name, bool throwOnError)
149 throw new NotImplementedException ("I was accessed");
152 public Assembly GetAssembly (AssemblyName name)
154 throw new NotImplementedException ("I was accessed");
157 public string GetPathOfAssembly (AssemblyName name)
159 throw new NotImplementedException ("I was accessed");
162 public Type GetType (string name, bool throwOnError, bool ignoreCase)
164 throw new NotImplementedException ("I was accessed");
167 public Type GetType (string name, bool throwOnError)
169 throw new NotImplementedException ("I was accessed");
172 public Type GetType (string name)
174 throw new NotImplementedException ("I was accessed");
177 public void ReferenceAssembly (AssemblyName name)