public void TimeoutIsSet() { TelegramModule.Initialize(ApiKey, 10); Assert.True(TelegramModule.Bot.RequestTimeout == 10000); TelegramModule.SetRequestTimeout(20); Assert.True(TelegramModule.Bot.RequestTimeout == 20000); }
public void RequestForCorrelationKeyReturnsErrorIfEntryIsNotFound() { TelegramModule.Initialize( MBTHelper.ConvertMaskedSecretToRealValue(Secrets.TELEGRAM_BOT_API_KEY.ToString()), 10); TelegramModule.SetDebugOutput(true); TelegramModule.SetRequestTimeout(10); var result = TelegramModule.GetMessageByCorrelationId("test"); var errorResponse = JsonConvert.DeserializeObject <Response <Error> >(result); Assert.False(errorResponse.IsSuccess); Assert.Equal(typeof(KeyNotFoundException).Name, errorResponse.Content.ExceptionType); }