/// <summary> /// Sets the DSL's IDateTimeNowAdapter. This is the injection point for tests to provide their own adapter /// implementation. /// </summary> /// <param name="adapter"><see cref="IDateTimeNowAdapter"/> implementation.</param> internal static void SetDateTimeNowAdapter(IDateTimeNowAdapter adapter) { lock (_syncLock) { _nowAdapter = adapter; } }
public void SetUpTest() { _nowAdapter = new TestDateTimeNowAdapter(new DateTime(2012, 1, 21, 23, 0, 0)); DateTimeExtensions.SetDateTimeNowAdapter(_nowAdapter); }
public void SetUpTest() { _nowAdapter = new TestDateTimeNowAdapter(DateTime.Now); DateTimeComponentsConversionToDateTime.SetDateTimeNowAdapter(_nowAdapter); }