mirror of
https://github.com/sochix/TLSharp.git
synced 2025-12-06 08:02:00 +01:00
It seems that after triggering a FloodException, and waiting the required time to be able to use Telegram again, TLSharp throws an exception. I include the way to reproduce this bug as an [Ignore]d test with the hope that someone may help me fix the problem soon. For reference, the whole stacktrace of the exception was: Test Name: FloodExceptionShouldNotCauseCannotReadPackageLengthError Test FullName: TLSharp.Tests.TLSharpTestsVS.FloodExceptionShouldNotCauseCannotReadPackageLengthError Test Source: D:\Projects\GitHub\TLSharp\TLSharp.Tests.VS\TLSharpTestsVs.cs : line 72 Test Outcome: Failed Test Duration: 0:04:30.7467012 Result StackTrace: at TLSharp.Core.Network.TcpTransport.<Receieve>d__4.MoveNext() in D:\Projects\GitHub\TLSharp\TLSharp.Core\Network\TcpTransport.cs:line 39 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at TLSharp.Core.Network.MtProtoSender.<Receive>d__9.MoveNext() in D:\Projects\GitHub\TLSharp\TLSharp.Core\Network\MtProtoSender.cs:line 139 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at TLSharp.Core.TelegramClient.<ConnectAsync>d__8.MoveNext() in D:\Projects\GitHub\TLSharp\TLSharp.Core\TelegramClient.cs:line 76 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at TLSharp.Tests.TLSharpTests.<CheckPhones>d__54.MoveNext() in D:\Projects\GitHub\TLSharp\TLSharp.Tests\TLSharpTests.cs:line 329 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at TLSharp.Tests.TLSharpTestsVS.<CheckPhones>d__9.MoveNext() in D:\Projects\GitHub\TLSharp\TLSharp.Tests.VS\TLSharpTestsVs.cs:line 68 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at TLSharp.Tests.TLSharpTests.<FloodExceptionShouldNotCauseCannotReadPackageLengthError>d__55.MoveNext() in D:\Projects\GitHub\TLSharp\TLSharp.Tests\TLSharpTests.cs:line 340 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at TLSharp.Tests.TLSharpTestsVS.<FloodExceptionShouldNotCauseCannotReadPackageLengthError>d__10.MoveNext() in D:\Projects\GitHub\TLSharp\TLSharp.Tests.VS\TLSharpTestsVs.cs:line 73 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() Result Message: Test method TLSharp.Tests.TLSharpTestsVS.FloodExceptionShouldNotCauseCannotReadPackageLengthError threw exception: System.InvalidOperationException: Couldn't read the packet length
78 lines
1.9 KiB
C#
78 lines
1.9 KiB
C#
|
|
using System.Threading.Tasks;
|
|
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
namespace TLSharp.Tests
|
|
{
|
|
[TestClass]
|
|
public class TLSharpTestsVS : TLSharpTests
|
|
{
|
|
[TestInitialize]
|
|
public void Init()
|
|
{
|
|
base.Init(o => Assert.IsNotNull(o), b => Assert.IsTrue(b));
|
|
}
|
|
|
|
[TestMethod]
|
|
public override async Task AuthUser()
|
|
{
|
|
await base.AuthUser();
|
|
}
|
|
|
|
[TestMethod]
|
|
public override async Task SendMessageTest()
|
|
{
|
|
await base.SendMessageTest();
|
|
}
|
|
|
|
[TestMethod]
|
|
public override async Task SendMessageToChannelTest()
|
|
{
|
|
await base.SendMessageToChannelTest();
|
|
}
|
|
|
|
[TestMethod]
|
|
public override async Task SendPhotoToContactTest()
|
|
{
|
|
await base.SendPhotoToContactTest();
|
|
}
|
|
|
|
[TestMethod]
|
|
public override async Task SendBigFileToContactTest()
|
|
{
|
|
await base.SendBigFileToContactTest();
|
|
}
|
|
|
|
[TestMethod]
|
|
public override async Task DownloadFileFromContactTest()
|
|
{
|
|
await base.DownloadFileFromContactTest();
|
|
}
|
|
|
|
[TestMethod]
|
|
public override async Task DownloadFileFromWrongLocationTest()
|
|
{
|
|
await base.DownloadFileFromWrongLocationTest();
|
|
}
|
|
|
|
[TestMethod]
|
|
public override async Task SignUpNewUser()
|
|
{
|
|
await base.SignUpNewUser();
|
|
}
|
|
|
|
[TestMethod]
|
|
public override async Task CheckPhones()
|
|
{
|
|
await base.CheckPhones();
|
|
}
|
|
[TestMethod]
|
|
[Ignore]
|
|
public override async Task FloodExceptionShouldNotCauseCannotReadPackageLengthError()
|
|
{
|
|
await base.FloodExceptionShouldNotCauseCannotReadPackageLengthError();
|
|
}
|
|
}
|
|
}
|