|
@@ -42,7 +42,7 @@ namespace Discord.Tests |
|
|
//Create new server and invite the other bots to it |
|
|
//Create new server and invite the other bots to it |
|
|
_testServer = _hostClient.CreateServer("Discord.Net Testing", _hostClient.Regions.First()).Result; |
|
|
_testServer = _hostClient.CreateServer("Discord.Net Testing", _hostClient.Regions.First()).Result; |
|
|
_testServerChannel = _testServer.DefaultChannel; |
|
|
_testServerChannel = _testServer.DefaultChannel; |
|
|
Invite invite = _testServer.CreateInvite(60, 1, false, false).Result; |
|
|
|
|
|
|
|
|
var invite = _testServer.CreateInvite(60, 2, false, false).Result; |
|
|
WaitAll( |
|
|
WaitAll( |
|
|
_targetBot.GetInvite(invite.Code).Result.Accept(), |
|
|
_targetBot.GetInvite(invite.Code).Result.Accept(), |
|
|
_observerBot.GetInvite(invite.Code).Result.Accept()); |
|
|
_observerBot.GetInvite(invite.Code).Result.Accept()); |
|
@@ -122,6 +122,8 @@ namespace Discord.Tests |
|
|
_observerBot.Disconnect()); |
|
|
_observerBot.Disconnect()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Unit Test Helpers |
|
|
|
|
|
|
|
|
private static void AssertEvent<TArgs>(string msg, Func<Task> action, Action<EventHandler<TArgs>> addEvent, Action<EventHandler<TArgs>> removeEvent, Func<object, TArgs, bool> test = null) |
|
|
private static void AssertEvent<TArgs>(string msg, Func<Task> action, Action<EventHandler<TArgs>> addEvent, Action<EventHandler<TArgs>> removeEvent, Func<object, TArgs, bool> test = null) |
|
|
{ |
|
|
{ |
|
|
AssertEvent(msg, action, addEvent, removeEvent, test, true); |
|
|
AssertEvent(msg, action, addEvent, removeEvent, test, true); |
|
|