/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
- //===============================================================================
- // Microsoft patterns & practices
- // Composite Application Guidance for Windows Presentation Foundation
- //===============================================================================
- // Copyright (c) Microsoft Corporation. All rights reserved.
- // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
- // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
- // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- // FITNESS FOR A PARTICULAR PURPOSE.
- //===============================================================================
- // The example companies, organizations, products, domain names,
- // e-mail addresses, logos, people, places, and events depicted
- // herein are fictitious. No association with any real company,
- // organization, product, domain name, email address, logo, person,
- // places, or events is intended or should be inferred.
- //===============================================================================
-
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Microsoft.Practices.Unity;
-
- namespace UIComposition.Modules.Project.Tests.Mocks
- {
- public class MockUnityContainer : IUnityContainer
- {
- public Dictionary<Type, Type> Types = new Dictionary<Type, Type>();
- private Dictionary<Type, object> Instances = new Dictionary<Type, object>();
-
- public IUnityContainer RegisterType<TFrom, TTo>() where TTo : TFrom
- {
- Types.Add(typeof(TFrom), typeof(TTo));
- return this;
- }
-
-
- #region IUnityContainer Members
-
- public IUnityContainer AddExtension(UnityContainerExtension extension)
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer AddNewExtension<TExtension>() where TExtension : UnityContainerExtension, new()
- {
- throw new NotImplementedException();
- }
-
- public object BuildUp(Type t, object existing, string name)
- {
- throw new NotImplementedException();
- }
-
- public object BuildUp(Type t, object existing)
- {
- throw new NotImplementedException();
- }
-
- public T BuildUp<T>(T existing, string name)
- {
- throw new NotImplementedException();
- }
-
- public T BuildUp<T>(T existing)
- {
- throw new NotImplementedException();
- }
-
- public object Configure(Type configurationInterface)
- {
- throw new NotImplementedException();
- }
-
- public TConfigurator Configure<TConfigurator>() where TConfigurator : IUnityContainerExtensionConfigurator
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer CreateChildContainer()
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer Parent
- {
- get { throw new NotImplementedException(); }
- }
-
- public IUnityContainer RegisterInstance(Type t, string name, object instance, LifetimeManager lifetime)
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer RegisterInstance(Type t, string name, object instance)
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer RegisterInstance(Type t, object instance, LifetimeManager lifetimeManager)
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer RegisterInstance(Type t, object instance)
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer RegisterInstance<TInterface>(string name, TInterface instance, LifetimeManager lifetimeManager)
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer RegisterInstance<TInterface>(string name, TInterface instance)
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer RegisterInstance<TInterface>(TInterface instance, LifetimeManager lifetimeManager)
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer RegisterInstance<TInterface>(TInterface instance)
- {
- Instances.Add(typeof(TInterface), instance);
- return this;
- }
-
- public IUnityContainer RegisterType(Type from, Type to, string name, LifetimeManager lifetimeManager)
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer RegisterType(Type t, string name, LifetimeManager lifetimeManager)
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer RegisterType(Type t, LifetimeManager lifetimeManager)
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer RegisterType(Type from, Type to, LifetimeManager lifetimeManager)
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer RegisterType(Type from, Type to, string name)
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer RegisterType(Type from, Type to)
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer RegisterType<T>(string name, LifetimeManager lifetimeManager)
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer RegisterType<T>(LifetimeManager lifetimeManager)
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer RegisterType<TFrom, TTo>(string name, LifetimeManager lifetimeManager) where TTo : TFrom
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer RegisterType<TFrom, TTo>(string name) where TTo : TFrom
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer RegisterType<TFrom, TTo>(LifetimeManager lifetimeManager) where TTo : TFrom
- {
- throw new NotImplementedException();
- }
-
- public IUnityContainer RemoveAllExtensions()
- {
- throw new NotImplementedException();
- }
-
- public object Resolve(Type t, string name)
- {
- throw new NotImplementedException();
- }
-
- public object Resolve(Type t)
- {
- throw new NotImplementedException();
- }
-
- public T Resolve<T>(string name)
- {
- throw new NotImplementedException();
- }
-
- public T Resolve<T>()
- {
- throw new NotImplementedException();
- }
-
- public IEnumerable<object> ResolveAll(Type t)
- {
- throw new NotImplementedException();
- }
-
- public IEnumerable<T> ResolveAll<T>()
- {
- throw new NotImplementedException();
- }
-
- public void Teardown(object o)
- {
- throw new NotImplementedException();
- }
-
- #endregion
-
- #region IDisposable Members
-
- public void Dispose()
- {
- throw new NotImplementedException();
- }
-
- #endregion
- }
- }