public async Task BotShouldProcessEventWithinTimeout() { var config = new AppSettings { ProcessEventTimeout = TimeSpan.FromSeconds(5.0) }; var welcomeService = new WelcomeService(config, _usersStore, _logger, _botMock.Object); const int testUserId = 123; await ProcessNewChatMember(welcomeService, testUserId, DateTime.UtcNow); Assert.Collection(_botMock.Invocations, getChatMember => Assert.Equal(nameof(ITelegramBotClient.GetChatMemberAsync), getChatMember.Method.Name), restrict => Assert.Equal(nameof(ITelegramBotClient.RestrictChatMemberAsync), restrict.Method.Name), sendMessage => Assert.Equal(nameof(ITelegramBotClient.SendTextMessageAsync), sendMessage.Method.Name)); Assert.Equal(testUserId, _usersStore.GetAll().Single().Id); }