/// <summary>
        ///   Implementations placed in a dictionary indexed by fullname for convenience of use
        ///   elsewhere in the system.
        /// </summary>
        public CacheImplementationSelector(ICollection<ICacheImplementation> implementations,
                                           CacheImplementationSelectorDelegate selectorDelegate)
        {
            Ensure.That(implementations.IsNotNull(), "key not supplied")
                .And(selectorDelegate.IsNotNull(), "selectorDelegate not supplied")
                .And(implementations.Count.IsBetweenInclusive(1, MaxImplementations), "invalid number of cacheImplementations");

            _selectorDelegate = selectorDelegate;
            foreach (var i in implementations.Where(i => i != null))
            {
                _implementations.Add(i.GetType().FullName, i);
            }

            if (!_implementations.Where(i => i.Value.IsEnabled).Any())
                throw new ArgumentException("One or more implementations supplied must be enabled.", "implementations");
        }
 public void Setup()
 {
     _stubCacheImplementationSelectorDelegate = MockRepository.GenerateStub<CacheImplementationSelectorDelegate>();
     _stubICacheImplementation = MockRepository.GenerateStub<ICacheImplementation>();
 }