public void Twice_should_throw_when_configuration_is_null() { // Arrange IRepeatConfiguration <IVoidConfiguration> repeatConfig = null; // Act var exception = Record.Exception(() => repeatConfig.Twice()); // Assert exception.Should().BeOfType <ArgumentNullException>(); }
/// <summary> /// Specifies NumberOfTimes(2) to the IRepeatConfiguration{TFake}. /// </summary> /// <typeparam name="TFake">The type of fake object.</typeparam> /// <param name="configuration">The configuration to set repeat 2 to.</param> public static void Twice(this IRepeatConfiguration configuration) { Guard.IsNotNull(configuration, "configuration"); configuration.NumberOfTimes(2); }
/// <summary> /// Specifies NumberOfTimes(2) to the repeat configuration. /// </summary> /// <typeparam name="TInterface">The type of configuration interface to return.</typeparam> /// <param name="configuration">The configuration to set repeat 2 to.</param> /// <returns>A configuration object that lets you define the subsequent behavior.</returns> public static IThenConfiguration <TInterface> Twice <TInterface>(this IRepeatConfiguration <TInterface> configuration) { Guard.AgainstNull(configuration, nameof(configuration)); return(configuration.NumberOfTimes(2)); }
/// <summary> /// Specifies NumberOfTimes(1) to the IRepeatConfiguration{TFake}. /// </summary> /// <param name="configuration">The configuration to set repeat 1 to.</param> public static void Once(this IRepeatConfiguration configuration) { Guard.AgainstNull(configuration, "configuration"); configuration.NumberOfTimes(1); }
public KeyPressRepeatHandler(IAction action, IRepeatConfiguration repeatConfiguration) { Action = action; RepeatConfiguration = repeatConfiguration; }
/// <summary> /// Specifies NumberOfTimes(1) to the IRepeatConfiguration{TFake}. /// </summary> /// <typeparam name="TFake">The type of fake object.</typeparam> /// <param name="configuration">The configuration to set repeat 1 to.</param> public static void Once <TFake>(this IRepeatConfiguration <TFake> configuration) { Guard.IsNotNull(configuration, "configuration"); configuration.NumberOfTimes(1); }
/// <summary> /// Specifies NumberOfTimes(2) to the repeat configuration. /// </summary> /// <param name="configuration">The configuration to set repeat 2 to.</param> public static void Twice(this IRepeatConfiguration configuration) { Guard.AgainstNull(configuration, nameof(configuration)); configuration.NumberOfTimes(2); }