TLSharp/TLSharp.Tests.NUnit/Test.cs

86 lines
1.9 KiB
C#
Raw Permalink Normal View History


using System;
using System.Threading.Tasks;
using NUnit.Framework;
namespace TLSharp.Tests
{
[TestFixture]
public class TLSharpTestsNUnit : TLSharpTests
{
[TestFixtureSetUp]
public void Init()
{
base.Init(o => Assert.IsNotNull(o), b => Assert.IsTrue(b));
}
[Test]
public async override Task AuthUser()
{
await base.AuthUser();
}
[Test]
public override async Task SendMessageTest()
{
await base.SendMessageTest();
}
[Test]
public override async Task SendMessageToChannelTest()
{
await base.SendMessageToChannelTest();
}
[Test]
public override async Task SendPhotoToContactTest()
{
await base.SendPhotoToContactTest();
}
[Test]
public override async Task SendBigFileToContactTest()
{
await base.SendBigFileToContactTest();
}
[Test]
public override async Task DownloadFileFromContactTest()
{
await base.DownloadFileFromContactTest();
}
[Test]
public override async Task DownloadFileFromWrongLocationTest()
{
await base.DownloadFileFromWrongLocationTest();
}
[Test]
public override async Task SignUpNewUser()
{
await base.SignUpNewUser();
}
[Test]
public override async Task CheckPhones()
{
await base.CheckPhones();
}
Tests: include testcase for "couldn't read packet length" bug 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
2016-11-29 18:28:22 +01:00
[Test]
[Ignore("FIXME")]
public override async Task FloodExceptionShouldNotCauseCannotReadPackageLengthError()
{
await base.FloodExceptionShouldNotCauseCannotReadPackageLengthError();
}
[Test]
public override async Task SendMessageByUserNameTest()
{
await base.SendMessageByUserNameTest();
}
}
}