Exemplo n.º 1
0
 private void Given_a_switch_factory_with_a_switch_initialised()
 {
     _switcher = Substitute.For <IProvideSwitches>();
     _switchProviderFactory = Substitute.For <ISwitchProviderFactory>();
     _switchProviderFactory.Create().Returns(_switcher);
     Features.Initialize(_switchProviderFactory);
 }
Exemplo n.º 2
0
 private void Given_a_switch_factory_with_a_switch_initialised()
 {
     _switcher = Substitute.For<IProvideSwitches>();
     _switchProviderFactory = Substitute.For<ISwitchProviderFactory>();
     _switchProviderFactory.Create().Returns(_switcher);
     Features.Initialize(_switchProviderFactory);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Sets the factory to use to create the concrete implementation of ISwitch
        /// </summary>
        /// <param name="factory">SwitchFactory to use to create concrete implementations of ISwitch</param>
        /// <remarks>This defaults to the custom Configuration file section</remarks>
        /// <exception cref="ArgumentNullException">Passing null will throw an exception</exception>
        public static void Initialize(ISwitchProviderFactory factory)
        {
            if (factory == null)
            {
                throw new ArgumentNullException("factory");
            }

            switchProviderFactory = factory;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Sets the factory to use to create the concrete implementation of ISwitch
        /// </summary>
        /// <param name="factory">SwitchFactory to use to create concrete implementations of ISwitch</param>
        /// <remarks>This defaults to the custom Configuration file section</remarks>
        /// <exception cref="ArgumentNullException">Passing null will throw an exception</exception>
        public static void Initialize(ISwitchProviderFactory factory)
        {
            if (factory == null) throw new ArgumentNullException("factory");

            switchProviderFactory = factory;
        }