PageRenderTime 51ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/V1/trunk/Source/QuickStarts/UIComposition/UIComposition.Modules.Project.Tests/Mocks/MockUnityContainer.cs

#
C# | 237 lines | 175 code | 46 blank | 16 comment | 0 complexity | 8c401bf5523af2fe26b52d9a308682fc 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 System.Linq;
  20. using System.Text;
  21. using Microsoft.Practices.Unity;
  22. namespace UIComposition.Modules.Project.Tests.Mocks
  23. {
  24. public class MockUnityContainer : IUnityContainer
  25. {
  26. public Dictionary<Type, Type> Types = new Dictionary<Type, Type>();
  27. private Dictionary<Type, object> Instances = new Dictionary<Type, object>();
  28. public IUnityContainer RegisterType<TFrom, TTo>() where TTo : TFrom
  29. {
  30. Types.Add(typeof(TFrom), typeof(TTo));
  31. return this;
  32. }
  33. #region IUnityContainer Members
  34. public IUnityContainer AddExtension(UnityContainerExtension extension)
  35. {
  36. throw new NotImplementedException();
  37. }
  38. public IUnityContainer AddNewExtension<TExtension>() where TExtension : UnityContainerExtension, new()
  39. {
  40. throw new NotImplementedException();
  41. }
  42. public object BuildUp(Type t, object existing, string name)
  43. {
  44. throw new NotImplementedException();
  45. }
  46. public object BuildUp(Type t, object existing)
  47. {
  48. throw new NotImplementedException();
  49. }
  50. public T BuildUp<T>(T existing, string name)
  51. {
  52. throw new NotImplementedException();
  53. }
  54. public T BuildUp<T>(T existing)
  55. {
  56. throw new NotImplementedException();
  57. }
  58. public object Configure(Type configurationInterface)
  59. {
  60. throw new NotImplementedException();
  61. }
  62. public TConfigurator Configure<TConfigurator>() where TConfigurator : IUnityContainerExtensionConfigurator
  63. {
  64. throw new NotImplementedException();
  65. }
  66. public IUnityContainer CreateChildContainer()
  67. {
  68. throw new NotImplementedException();
  69. }
  70. public IUnityContainer Parent
  71. {
  72. get { throw new NotImplementedException(); }
  73. }
  74. public IUnityContainer RegisterInstance(Type t, string name, object instance, LifetimeManager lifetime)
  75. {
  76. throw new NotImplementedException();
  77. }
  78. public IUnityContainer RegisterInstance(Type t, string name, object instance)
  79. {
  80. throw new NotImplementedException();
  81. }
  82. public IUnityContainer RegisterInstance(Type t, object instance, LifetimeManager lifetimeManager)
  83. {
  84. throw new NotImplementedException();
  85. }
  86. public IUnityContainer RegisterInstance(Type t, object instance)
  87. {
  88. throw new NotImplementedException();
  89. }
  90. public IUnityContainer RegisterInstance<TInterface>(string name, TInterface instance, LifetimeManager lifetimeManager)
  91. {
  92. throw new NotImplementedException();
  93. }
  94. public IUnityContainer RegisterInstance<TInterface>(string name, TInterface instance)
  95. {
  96. throw new NotImplementedException();
  97. }
  98. public IUnityContainer RegisterInstance<TInterface>(TInterface instance, LifetimeManager lifetimeManager)
  99. {
  100. throw new NotImplementedException();
  101. }
  102. public IUnityContainer RegisterInstance<TInterface>(TInterface instance)
  103. {
  104. Instances.Add(typeof(TInterface), instance);
  105. return this;
  106. }
  107. public IUnityContainer RegisterType(Type from, Type to, string name, LifetimeManager lifetimeManager)
  108. {
  109. throw new NotImplementedException();
  110. }
  111. public IUnityContainer RegisterType(Type t, string name, LifetimeManager lifetimeManager)
  112. {
  113. throw new NotImplementedException();
  114. }
  115. public IUnityContainer RegisterType(Type t, LifetimeManager lifetimeManager)
  116. {
  117. throw new NotImplementedException();
  118. }
  119. public IUnityContainer RegisterType(Type from, Type to, LifetimeManager lifetimeManager)
  120. {
  121. throw new NotImplementedException();
  122. }
  123. public IUnityContainer RegisterType(Type from, Type to, string name)
  124. {
  125. throw new NotImplementedException();
  126. }
  127. public IUnityContainer RegisterType(Type from, Type to)
  128. {
  129. throw new NotImplementedException();
  130. }
  131. public IUnityContainer RegisterType<T>(string name, LifetimeManager lifetimeManager)
  132. {
  133. throw new NotImplementedException();
  134. }
  135. public IUnityContainer RegisterType<T>(LifetimeManager lifetimeManager)
  136. {
  137. throw new NotImplementedException();
  138. }
  139. public IUnityContainer RegisterType<TFrom, TTo>(string name, LifetimeManager lifetimeManager) where TTo : TFrom
  140. {
  141. throw new NotImplementedException();
  142. }
  143. public IUnityContainer RegisterType<TFrom, TTo>(string name) where TTo : TFrom
  144. {
  145. throw new NotImplementedException();
  146. }
  147. public IUnityContainer RegisterType<TFrom, TTo>(LifetimeManager lifetimeManager) where TTo : TFrom
  148. {
  149. throw new NotImplementedException();
  150. }
  151. public IUnityContainer RemoveAllExtensions()
  152. {
  153. throw new NotImplementedException();
  154. }
  155. public object Resolve(Type t, string name)
  156. {
  157. throw new NotImplementedException();
  158. }
  159. public object Resolve(Type t)
  160. {
  161. throw new NotImplementedException();
  162. }
  163. public T Resolve<T>(string name)
  164. {
  165. throw new NotImplementedException();
  166. }
  167. public T Resolve<T>()
  168. {
  169. throw new NotImplementedException();
  170. }
  171. public IEnumerable<object> ResolveAll(Type t)
  172. {
  173. throw new NotImplementedException();
  174. }
  175. public IEnumerable<T> ResolveAll<T>()
  176. {
  177. throw new NotImplementedException();
  178. }
  179. public void Teardown(object o)
  180. {
  181. throw new NotImplementedException();
  182. }
  183. #endregion
  184. #region IDisposable Members
  185. public void Dispose()
  186. {
  187. throw new NotImplementedException();
  188. }
  189. #endregion
  190. }
  191. }