PageRenderTime 57ms CodeModel.GetById 32ms RepoModel.GetById 1ms app.codeStats 0ms

/V1/trunk/Source/StockTraderRI/StockTraderRI.Modules.WatchList.Tests/Mocks/MockUnityResolver.cs

#
C# | 235 lines | 170 code | 47 blank | 18 comment | 0 complexity | 4cdb864fe575b2ff9b4a111f7c1e4ad2 MD5 | raw file
  1. //===============================================================================
  2. // Microsoft patterns & practices
  3. // Composite Application Guidance for Windows Presentation Foundation
  4. //===============================================================================
  5. // Copyright (c) Microsoft Corporation. All rights reserved.
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
  7. // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
  8. // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  9. // FITNESS FOR A PARTICULAR PURPOSE.
  10. //===============================================================================
  11. // The example companies, organizations, products, domain names,
  12. // e-mail addresses, logos, people, places, and events depicted
  13. // herein are fictitious. No association with any real company,
  14. // organization, product, domain name, email address, logo, person,
  15. // places, or events is intended or should be inferred.
  16. //===============================================================================
  17. using System;
  18. using System.Collections.Generic;
  19. using Microsoft.Practices.Unity;
  20. namespace StockTraderRI.Modules.WatchList.Tests.Mocks
  21. {
  22. class MockUnityResolver : IUnityContainer
  23. {
  24. public readonly Dictionary<Type, object> Bag = new Dictionary<Type, object>();
  25. public T Resolve<T>()
  26. {
  27. return (T)Bag[typeof(T)];
  28. }
  29. public IUnityContainer RegisterType<TFrom, TTo>(LifetimeManager lifetimeManager) where TTo : TFrom
  30. {
  31. //ignore
  32. return this;
  33. }
  34. public IUnityContainer RegisterType<TFrom, TTo>() where TTo : TFrom
  35. {
  36. //ignore
  37. return this;
  38. }
  39. #region IUnityContainer Members
  40. public IUnityContainer AddExtension(UnityContainerExtension extension)
  41. {
  42. throw new NotImplementedException();
  43. }
  44. public IUnityContainer AddNewExtension<TExtension>() where TExtension : UnityContainerExtension, new()
  45. {
  46. throw new NotImplementedException();
  47. }
  48. public object BuildUp(Type t, object existing, string name)
  49. {
  50. throw new NotImplementedException();
  51. }
  52. public object BuildUp(Type t, object existing)
  53. {
  54. throw new NotImplementedException();
  55. }
  56. public T BuildUp<T>(T existing, string name)
  57. {
  58. throw new NotImplementedException();
  59. }
  60. public T BuildUp<T>(T existing)
  61. {
  62. throw new NotImplementedException();
  63. }
  64. public object Configure(Type configurationInterface)
  65. {
  66. throw new NotImplementedException();
  67. }
  68. public TConfigurator Configure<TConfigurator>() where TConfigurator : IUnityContainerExtensionConfigurator
  69. {
  70. throw new NotImplementedException();
  71. }
  72. public IUnityContainer CreateChildContainer()
  73. {
  74. throw new NotImplementedException();
  75. }
  76. public IUnityContainer Parent
  77. {
  78. get { throw new NotImplementedException(); }
  79. }
  80. public IUnityContainer RegisterInstance(Type t, string name, object instance, LifetimeManager lifetime)
  81. {
  82. throw new NotImplementedException();
  83. }
  84. public IUnityContainer RegisterInstance(Type t, string name, object instance)
  85. {
  86. throw new NotImplementedException();
  87. }
  88. public IUnityContainer RegisterInstance(Type t, object instance, LifetimeManager lifetimeManager)
  89. {
  90. throw new NotImplementedException();
  91. }
  92. public IUnityContainer RegisterInstance(Type t, object instance)
  93. {
  94. throw new NotImplementedException();
  95. }
  96. public IUnityContainer RegisterInstance<TInterface>(string name, TInterface instance, LifetimeManager lifetimeManager)
  97. {
  98. throw new NotImplementedException();
  99. }
  100. public IUnityContainer RegisterInstance<TInterface>(string name, TInterface instance)
  101. {
  102. throw new NotImplementedException();
  103. }
  104. public IUnityContainer RegisterInstance<TInterface>(TInterface instance, LifetimeManager lifetimeManager)
  105. {
  106. throw new NotImplementedException();
  107. }
  108. public IUnityContainer RegisterInstance<TInterface>(TInterface instance)
  109. {
  110. throw new NotImplementedException();
  111. }
  112. public IUnityContainer RegisterType(Type from, Type to, string name, LifetimeManager lifetimeManager)
  113. {
  114. throw new NotImplementedException();
  115. }
  116. public IUnityContainer RegisterType(Type t, string name, LifetimeManager lifetimeManager)
  117. {
  118. throw new NotImplementedException();
  119. }
  120. public IUnityContainer RegisterType(Type t, LifetimeManager lifetimeManager)
  121. {
  122. throw new NotImplementedException();
  123. }
  124. public IUnityContainer RegisterType(Type from, Type to, LifetimeManager lifetimeManager)
  125. {
  126. throw new NotImplementedException();
  127. }
  128. public IUnityContainer RegisterType(Type from, Type to, string name)
  129. {
  130. throw new NotImplementedException();
  131. }
  132. public IUnityContainer RegisterType(Type from, Type to)
  133. {
  134. throw new NotImplementedException();
  135. }
  136. public IUnityContainer RegisterType<T>(string name, LifetimeManager lifetimeManager)
  137. {
  138. throw new NotImplementedException();
  139. }
  140. public IUnityContainer RegisterType<T>(LifetimeManager lifetimeManager)
  141. {
  142. throw new NotImplementedException();
  143. }
  144. public IUnityContainer RegisterType<TFrom, TTo>(string name, LifetimeManager lifetimeManager) where TTo : TFrom
  145. {
  146. throw new NotImplementedException();
  147. }
  148. public IUnityContainer RegisterType<TFrom, TTo>(string name) where TTo : TFrom
  149. {
  150. throw new NotImplementedException();
  151. }
  152. public IUnityContainer RemoveAllExtensions()
  153. {
  154. throw new NotImplementedException();
  155. }
  156. public object Resolve(Type t, string name)
  157. {
  158. throw new NotImplementedException();
  159. }
  160. public object Resolve(Type t)
  161. {
  162. throw new NotImplementedException();
  163. }
  164. public T Resolve<T>(string name)
  165. {
  166. throw new NotImplementedException();
  167. }
  168. public IEnumerable<object> ResolveAll(Type t)
  169. {
  170. throw new NotImplementedException();
  171. }
  172. public IEnumerable<T> ResolveAll<T>()
  173. {
  174. throw new NotImplementedException();
  175. }
  176. public void Teardown(object o)
  177. {
  178. throw new NotImplementedException();
  179. }
  180. #endregion
  181. #region IDisposable Members
  182. public void Dispose()
  183. {
  184. throw new NotImplementedException();
  185. }
  186. #endregion
  187. }
  188. }