示例#1
0
        public async Task CreateObservableIntervallFailureShouldLogError()
        {
            // ARRANGE
            await using var app = new BaseTestRxApp();
            await app.StartUpAsync(DefaultDaemonHost).ConfigureAwait(false);

            app.IsEnabled = true;

            // ACT
            using var disposable = app.CreateObservableIntervall(TimeSpan.FromMilliseconds(10), () => throw new Exception("hello!"));

            await Task.Delay(150).ConfigureAwait(false);

            // ASSERT
            LoggerMock.AssertLogged(LogLevel.Error, Times.AtLeastOnce());
        }
示例#2
0
        public async Task CreateObservableIntervallShouldCallFunction()
        {
            // ARRANGE
            var app = new BaseTestRxApp();

            app.IsEnabled = true;

            var called = false;

            // ACT
            using var disposable = app.CreateObservableIntervall(TimeSpan.FromMilliseconds(10), () => called = true);

            await Task.Delay(150);

            // ASSERT
            Assert.True(called);
        }