コード例 #1
0
 public AbstractionConfigurator(IAbstractionConfigurationCollection abstractionConfigurationCollection,
                                IClassWrapperCreator classWrapperCreator, IImplementationConfigurationCache implementationConfigurationCache,
                                IImplementationCache implementationCache)
 {
     worker = new AbstractionConfigurator(typeof(T), abstractionConfigurationCollection, classWrapperCreator,
                                          implementationConfigurationCache, implementationCache);
 }
コード例 #2
0
        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));
        }
コード例 #3
0
 public ContainerConfigurator(IAbstractionConfigurationCollection abstractionConfigurationCollection,
                              IClassWrapperCreator classWrapperCreator,
                              IImplementationConfigurationCache implementationConfigurationCache, IImplementationCache implementationCache)
 {
     this.abstractionConfigurationCollection = abstractionConfigurationCollection;
     this.classWrapperCreator = classWrapperCreator;
     this.implementationConfigurationCache = implementationConfigurationCache;
     this.implementationCache = implementationCache;
 }
コード例 #4
0
        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));
 }
コード例 #7
0
        public IAbstractionConfiguration Get(Type abstractionType)
        {
            IAbstractionConfigurationCollection collection = ChooseCollection(abstractionType);

            return(collection.Get(abstractionType));
        }