public void Passing_a_parsed_date_to_FromUtcTime_results_in_UtcNow_being_that_date() { var dateTime = DateTime.Parse("2001-01-01 00:00"); var source = DummyTimeSource.FromÚtcTime(dateTime); source.UtcNow.Should().Be(dateTime); }
public void FromUtcTime_returns_an_instance_with_UtcTime_equal_to_supplied_value() { DateTime utcNow = DateTime.UtcNow; var uut = DummyTimeSource.FromÚtcTime(utcNow); uut.UtcNow.Should().Be(utcNow); }
public void SetupTask() { _container = new WindsorContainer(); _container.ConfigureWiringForTestsCallBeforeAllOtherWiring(); _messageReceiver = new MessageReceiver(); _timeSource = DummyTimeSource.FromLocalTime(DateTime.Parse("2015-01-01 10:00")); _container.Register( Component.For <DummyTimeSource>().Instance(_timeSource), Component.For <IServiceBus>().ImplementedBy <TestingOnlyServiceBus>().LifestyleScoped(), Component.For <IWindsorContainer>().Instance(_container), Component.For <IHandleMessages <ScheduledMessage> >().Instance(_messageReceiver) ); _container.ConfigureWiringForTestsCallAfterAllOtherWiring(); _scope = _container.BeginScope(); _bus = _container.Resolve <IServiceBus>(); }
public TestingOnlyServiceBus(IWindsorContainer container, DummyTimeSource timeSource) : base(container) { _timeSource = timeSource; timeSource.UtcNowChanged.Subscribe(SendDueMessages); }