public AbstractionConfigurator(IAbstractionConfigurationCollection abstractionConfigurationCollection, IClassWrapperCreator classWrapperCreator, IImplementationConfigurationCache implementationConfigurationCache, IImplementationCache implementationCache) { worker = new AbstractionConfigurator(typeof(T), abstractionConfigurationCollection, classWrapperCreator, implementationConfigurationCache, implementationCache); }
public CompositeCollection MakeChildCollection(IAbstractionConfigurationCollection childCollection) { var newCollections = new IAbstractionConfigurationCollection[rootToChildCollections.Length + 1]; Array.Copy(rootToChildCollections, newCollections, rootToChildCollections.Length); newCollections[rootToChildCollections.Length] = childCollection; return(new CompositeCollection(newCollections, selector)); }
public ContainerConfigurator(IAbstractionConfigurationCollection abstractionConfigurationCollection, IClassWrapperCreator classWrapperCreator, IImplementationConfigurationCache implementationConfigurationCache, IImplementationCache implementationCache) { this.abstractionConfigurationCollection = abstractionConfigurationCollection; this.classWrapperCreator = classWrapperCreator; this.implementationConfigurationCache = implementationConfigurationCache; this.implementationCache = implementationCache; }
public void Add(Type abstractionType, IAbstractionConfiguration abstractionConfiguration) { IAbstractionConfigurationCollection collection = ChooseCollection(abstractionType); if (!ReferenceEquals(collection, leafCollection)) { throw new InvalidOperationException(string.Format("Тип {0} нельзя конфигурировать", abstractionType)); } leafCollection.Add(abstractionType, abstractionConfiguration); }
public static void ExpectGetAll(this IAbstractionConfigurationCollection mock, IAbstractionConfiguration[] configurations) { Expect .Once .On(mock) .Method("GetAll") .WithNoArguments() .Will(Return.Value(configurations)); }
public static void ExpectGet(this IAbstractionConfigurationCollection mock, Type abstractionType, IAbstractionConfiguration result) { Expect .Once .On(mock) .Method("Get") .With(abstractionType) .Will(Return.Value(result)); }
public IAbstractionConfiguration Get(Type abstractionType) { IAbstractionConfigurationCollection collection = ChooseCollection(abstractionType); return(collection.Get(abstractionType)); }