diff --git a/Discord.Net.Tests/ChannelTests.cs b/Discord.Net.Tests/ChannelTests.cs
deleted file mode 100644
index c88d69590..000000000
--- a/Discord.Net.Tests/ChannelTests.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace Discord.Net.Tests
-{
- [TestClass]
- public class ChannelTests
- {
- private DiscordClient _bot1, _bot2;
-
- [TestInitialize]
- public void Initialize()
- {
- _bot1 = new DiscordClient();
- _bot2 = new DiscordClient();
-
- _bot1.Connect(Settings.Test1_Username, Settings.Test1_Password).Wait();
- _bot2.Connect(Settings.Test2_Username, Settings.Test2_Password).Wait();
-
- //Cleanup existing servers
- Task.WaitAll(_bot1.Servers.Select(x => _bot1.LeaveServer(x)).ToArray());
- Task.WaitAll(_bot2.Servers.Select(x => _bot2.LeaveServer(x)).ToArray());
- }
-
- [TestMethod]
- public async Task DoNothing()
- {
- Server server = await _bot1.CreateServer("Discord.Net Testbed", Region.US_East);
- Invite invite = await _bot1.CreateInvite(server, 60, 1, false, false);
- await _bot2.AcceptInvite(invite);
- await _bot2.LeaveServer(server);
- }
-
- [TestCleanup]
- public void Cleanup()
- {
- if (_bot1.IsConnected)
- Task.WaitAll(_bot1.Servers.Select(x => _bot1.LeaveServer(x)).ToArray());
- if (_bot2.IsConnected)
- Task.WaitAll(_bot2.Servers.Select(x => _bot2.LeaveServer(x)).ToArray());
-
- _bot1.Disconnect().Wait();
- _bot2.Disconnect().Wait();
- }
- }
-}
diff --git a/Discord.Net.Tests/Discord.Net.Tests.csproj b/Discord.Net.Tests/Discord.Net.Tests.csproj
index 89ea64202..af0d9e395 100644
--- a/Discord.Net.Tests/Discord.Net.Tests.csproj
+++ b/Discord.Net.Tests/Discord.Net.Tests.csproj
@@ -50,7 +50,7 @@
-
+
diff --git a/Discord.Net.Tests/Tests.cs b/Discord.Net.Tests/Tests.cs
new file mode 100644
index 000000000..2b32c57c4
--- /dev/null
+++ b/Discord.Net.Tests/Tests.cs
@@ -0,0 +1,103 @@
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Discord.Net.Tests
+{
+ [TestClass]
+ public class Tests
+ {
+ private DiscordClient _bot1, _bot2;
+ private Server _testServer;
+ private Channel _testServerChannel;
+ private Random _random;
+
+ [TestInitialize]
+ public void Initialize()
+ {
+ _random = new Random();
+
+ _bot1 = new DiscordClient();
+ _bot2 = new DiscordClient();
+
+ _bot1.Connect(Settings.Test1_Username, Settings.Test1_Password).Wait();
+ _bot2.Connect(Settings.Test2_Username, Settings.Test2_Password).Wait();
+
+ //Cleanup existing servers
+ Task.WaitAll(_bot1.Servers.Select(x => _bot1.LeaveServer(x)).ToArray());
+ Task.WaitAll(_bot2.Servers.Select(x => _bot2.LeaveServer(x)).ToArray());
+
+ _testServer = _bot1.CreateServer("Discord.Net Testbed", Region.US_East).Result;
+ _testServerChannel = _testServer.DefaultChannel;
+ Invite invite = _bot1.CreateInvite(_testServer, 60, 1, false, false).Result;
+ _bot2.AcceptInvite(invite).Wait();
+ }
+
+ [TestMethod]
+ public void TestSendMessage()
+ {
+ string text = $"test_{_random.Next()}";
+ AssertEvent(
+ "MessageCreated event never received",
+ () => _bot1.SendMessage(_testServerChannel, text),
+ x => _bot2.MessageCreated += x,
+ x => _bot2.MessageCreated -= x,
+ (s, e) => e.Message.Text == text);
+ }
+
+ [TestMethod]
+ public void TestCreateRoom()
+ {
+ Channel channel;
+ string name = $"test_{_random.Next()}";
+ AssertEvent(
+ "ChannelCreated event never received",
+ () => channel = _bot1.CreateChannel(_testServerChannel, name),
+ x => _bot2.ChannelCreated += x,
+ x => _bot2.ChannelCreated -= x,
+ (s, e) => e.Channel.Name == name);
+
+ AssertEvent(
+ "ChannelDestroyed event never received",
+ () => _bot1.DestroyChannel(channel),
+ x => _bot2.ChannelDestroyed += x,
+ x => _bot2.ChannelDestroyed -= x,
+ (s, e) => e.Channel.Name == name);
+ }
+
+ [TestCleanup]
+ public void Cleanup()
+ {
+ if (_bot1.IsConnected)
+ Task.WaitAll(_bot1.Servers.Select(x => _bot1.LeaveServer(x)).ToArray());
+ if (_bot2.IsConnected)
+ Task.WaitAll(_bot2.Servers.Select(x => _bot2.LeaveServer(x)).ToArray());
+
+ _bot1.Disconnect().Wait();
+ _bot2.Disconnect().Wait();
+ }
+
+ private void AssertEvent(string msg, Action action, Action> addEvent, Action> removeEvent, Func