public async Task RunInFailureShouldLogError() { // ARRANGE await InitializeFakeDaemon().ConfigureAwait(false); // ACT DefaultDaemonRxApp.RunIn(TimeSpan.FromMilliseconds(100), () => throw new Exception("RxError")); // ASSERT await Task.Delay(150).ConfigureAwait(false); await RunFakeDaemonUntilTimeout().ConfigureAwait(false); LoggerMock.AssertLogged(LogLevel.Error, Times.Once()); }
public async Task RunInShouldCallFunction() { // ARRANGE var called = false; await InitializeFakeDaemon().ConfigureAwait(false); // ACT DefaultDaemonRxApp.RunIn(TimeSpan.FromMilliseconds(100), () => called = true); // ASSERT Assert.False(called); await Task.Delay(150).ConfigureAwait(false); await RunFakeDaemonUntilTimeout().ConfigureAwait(false); Assert.True(called); }