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); }
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); }
/// <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; }
/// <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; }