private static LocalMachineTime Create() { var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); var configuration = new BaseTimeConfiguration(); return(new LocalMachineTime(fixture.Create <ILogger>(), configuration)); }
/// <summary> /// Initializes a new instance of the <see cref="RedisServerUnixTime" /> class. /// </summary> /// <param name="timeLua">The time lua.</param> /// <param name="log">The log.</param> /// <param name="configuration">The configuration.</param> public RedisServerUnixTime(TimeLua timeLua, ILogger log, BaseTimeConfiguration configuration) : base(log, configuration) { Guard.NotNull(() => timeLua, timeLua); _timeLua = timeLua; }
/// <summary> /// Initializes a new instance of the <see cref="QueueProducerConfiguration" /> class. /// </summary> /// <param name="transportConfiguration">The transport configuration.</param> /// <param name="headers">The headers.</param> /// <param name="additionalConfiguration">The additional configuration.</param> /// <param name="timeConfiguration">The time configuration.</param> /// <param name="sendPolicies">The send policies.</param> public QueueProducerConfiguration(TransportConfigurationSend transportConfiguration, IHeaders headers, IConfiguration additionalConfiguration, BaseTimeConfiguration timeConfiguration, IPolicies sendPolicies) : base(transportConfiguration, headers, additionalConfiguration, timeConfiguration, sendPolicies) { }
public void Create() { var test = new BaseTimeConfiguration(); Assert.Equal(TimeSpan.FromSeconds(900), test.RefreshTime); test.RefreshTime = TimeSpan.FromSeconds(100); Assert.Equal(TimeSpan.FromSeconds(100), test.RefreshTime); }
/// <summary> /// Initializes a new instance of the <see cref="QueueProducerConfiguration" /> class. /// </summary> /// <param name="transportConfiguration">The transport configuration.</param> /// <param name="headers">The headers.</param> /// <param name="additionalConfiguration">The additional configuration.</param> /// <param name="timeConfiguration">The time configuration.</param> public QueueProducerConfiguration(TransportConfigurationSend transportConfiguration, IHeaders headers, IConfiguration additionalConfiguration, BaseTimeConfiguration timeConfiguration) : base(transportConfiguration, headers, additionalConfiguration, timeConfiguration) { }
/// <summary> /// Initializes a new instance of the <see cref="BaseTime" /> class. /// </summary> /// <param name="log">The log.</param> /// <param name="configuration">The configuration.</param> protected BaseTime(ILogFactory log, BaseTimeConfiguration configuration) { Guard.NotNull(() => log, log); Guard.NotNull(() => configuration, configuration); Configuration = configuration; Log = log.Create(); }
/// <summary> /// Initializes a new instance of the <see cref="BaseTime" /> class. /// </summary> /// <param name="log">The log.</param> /// <param name="configuration">The configuration.</param> protected BaseTime(ILogger log, BaseTimeConfiguration configuration) { Guard.NotNull(() => log, log); Guard.NotNull(() => configuration, configuration); Configuration = configuration; Log = log; }
/// <summary> /// Initializes a new instance of the <see cref="SqlServerTime" /> class. /// </summary> /// <param name="log">The log.</param> /// <param name="configuration">The configuration.</param> /// <param name="connectionInformation">The connection information.</param> /// <param name="dateTimeQueryHandler">The date time query handler.</param> public SqlServerTime(ILogger log, BaseTimeConfiguration configuration, IConnectionInformation connectionInformation, IQueryHandler <GetUtcDateQuery, DateTime> dateTimeQueryHandler) : base(log, configuration) { Guard.NotNull(() => connectionInformation, connectionInformation); Guard.NotNull(() => dateTimeQueryHandler, dateTimeQueryHandler); _queryHandler = dateTimeQueryHandler; _connectionInformation = connectionInformation; }
/// <summary> /// Initializes a new instance of the <see cref="LocalMachineTime"/> class. /// </summary> /// <param name="log">The log.</param> /// <param name="configuration">The configuration.</param> public LocalMachineTime(ILogFactory log, BaseTimeConfiguration configuration) : base(log, configuration) { }
/// <summary> /// Initializes a new instance of the <see cref="RedisServerUnixTime" /> class. /// </summary> /// <param name="log">The log.</param> /// <param name="configuration">The configuration.</param> protected BaseUnixTime(ILogFactory log, BaseTimeConfiguration configuration) : base(log, configuration) { }
/// <summary> /// Initializes a new instance of the <see cref="RedisServerUnixTime" /> class. /// </summary> /// <param name="log">The log.</param> /// <param name="configuration">The configuration.</param> public LocalMachineUnixTime(ILogger log, BaseTimeConfiguration configuration) : base(log, configuration) { }