PageRenderTime 23ms CodeModel.GetById 8ms app.highlight 12ms RepoModel.GetById 1ms 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
 18using System;
 19using System.Collections.Generic;
 20using System.Linq;
 21using System.Text;
 22using Microsoft.Practices.Unity;
 23
 24namespace UIComposition.Modules.Project.Tests.Mocks
 25{
 26    public class MockUnityContainer : IUnityContainer
 27    {
 28        public Dictionary<Type, Type> Types = new Dictionary<Type, Type>();
 29        private Dictionary<Type, object> Instances = new Dictionary<Type, object>();
 30
 31        public IUnityContainer RegisterType<TFrom, TTo>() where TTo : TFrom
 32        {
 33            Types.Add(typeof(TFrom), typeof(TTo));
 34            return this;
 35        }
 36
 37
 38        #region IUnityContainer Members
 39
 40        public IUnityContainer AddExtension(UnityContainerExtension extension)
 41        {
 42            throw new NotImplementedException();
 43        }
 44
 45        public IUnityContainer AddNewExtension<TExtension>() where TExtension : UnityContainerExtension, new()
 46        {
 47            throw new NotImplementedException();
 48        }
 49
 50        public object BuildUp(Type t, object existing, string name)
 51        {
 52            throw new NotImplementedException();
 53        }
 54
 55        public object BuildUp(Type t, object existing)
 56        {
 57            throw new NotImplementedException();
 58        }
 59
 60        public T BuildUp<T>(T existing, string name)
 61        {
 62            throw new NotImplementedException();
 63        }
 64
 65        public T BuildUp<T>(T existing)
 66        {
 67            throw new NotImplementedException();
 68        }
 69
 70        public object Configure(Type configurationInterface)
 71        {
 72            throw new NotImplementedException();
 73        }
 74
 75        public TConfigurator Configure<TConfigurator>() where TConfigurator : IUnityContainerExtensionConfigurator
 76        {
 77            throw new NotImplementedException();
 78        }
 79
 80        public IUnityContainer CreateChildContainer()
 81        {
 82            throw new NotImplementedException();
 83        }
 84
 85        public IUnityContainer Parent
 86        {
 87            get { throw new NotImplementedException(); }
 88        }
 89
 90        public IUnityContainer RegisterInstance(Type t, string name, object instance, LifetimeManager lifetime)
 91        {
 92            throw new NotImplementedException();
 93        }
 94
 95        public IUnityContainer RegisterInstance(Type t, string name, object instance)
 96        {
 97            throw new NotImplementedException();
 98        }
 99
100        public IUnityContainer RegisterInstance(Type t, object instance, LifetimeManager lifetimeManager)
101        {
102            throw new NotImplementedException();
103        }
104
105        public IUnityContainer RegisterInstance(Type t, object instance)
106        {
107            throw new NotImplementedException();
108        }
109
110        public IUnityContainer RegisterInstance<TInterface>(string name, TInterface instance, LifetimeManager lifetimeManager)
111        {
112            throw new NotImplementedException();
113        }
114
115        public IUnityContainer RegisterInstance<TInterface>(string name, TInterface instance)
116        {
117            throw new NotImplementedException();
118        }
119
120        public IUnityContainer RegisterInstance<TInterface>(TInterface instance, LifetimeManager lifetimeManager)
121        {
122            throw new NotImplementedException();
123        }
124
125        public IUnityContainer RegisterInstance<TInterface>(TInterface instance)
126        {
127            Instances.Add(typeof(TInterface), instance);
128            return this;
129        }
130
131        public IUnityContainer RegisterType(Type from, Type to, string name, LifetimeManager lifetimeManager)
132        {
133            throw new NotImplementedException();
134        }
135
136        public IUnityContainer RegisterType(Type t, string name, LifetimeManager lifetimeManager)
137        {
138            throw new NotImplementedException();
139        }
140
141        public IUnityContainer RegisterType(Type t, LifetimeManager lifetimeManager)
142        {
143            throw new NotImplementedException();
144        }
145
146        public IUnityContainer RegisterType(Type from, Type to, LifetimeManager lifetimeManager)
147        {
148            throw new NotImplementedException();
149        }
150
151        public IUnityContainer RegisterType(Type from, Type to, string name)
152        {
153            throw new NotImplementedException();
154        }
155
156        public IUnityContainer RegisterType(Type from, Type to)
157        {
158            throw new NotImplementedException();
159        }
160
161        public IUnityContainer RegisterType<T>(string name, LifetimeManager lifetimeManager)
162        {
163            throw new NotImplementedException();
164        }
165
166        public IUnityContainer RegisterType<T>(LifetimeManager lifetimeManager)
167        {
168            throw new NotImplementedException();
169        }
170
171        public IUnityContainer RegisterType<TFrom, TTo>(string name, LifetimeManager lifetimeManager) where TTo : TFrom
172        {
173            throw new NotImplementedException();
174        }
175
176        public IUnityContainer RegisterType<TFrom, TTo>(string name) where TTo : TFrom
177        {
178            throw new NotImplementedException();
179        }
180
181        public IUnityContainer RegisterType<TFrom, TTo>(LifetimeManager lifetimeManager) where TTo : TFrom
182        {
183            throw new NotImplementedException();
184        }
185
186        public IUnityContainer RemoveAllExtensions()
187        {
188            throw new NotImplementedException();
189        }
190
191        public object Resolve(Type t, string name)
192        {
193            throw new NotImplementedException();
194        }
195
196        public object Resolve(Type t)
197        {
198            throw new NotImplementedException();
199        }
200
201        public T Resolve<T>(string name)
202        {
203            throw new NotImplementedException();
204        }
205
206        public T Resolve<T>()
207        {
208            throw new NotImplementedException();
209        }
210
211        public IEnumerable<object> ResolveAll(Type t)
212        {
213            throw new NotImplementedException();
214        }
215
216        public IEnumerable<T> ResolveAll<T>()
217        {
218            throw new NotImplementedException();
219        }
220
221        public void Teardown(object o)
222        {
223            throw new NotImplementedException();
224        }
225
226        #endregion
227
228        #region IDisposable Members
229
230        public void Dispose()
231        {
232            throw new NotImplementedException();
233        }
234
235        #endregion
236    }
237}