Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
swiftyspiffy committed Sep 16, 2018
2 parents 36aeaf7 + 32f3d41 commit 5b98f26
Show file tree
Hide file tree
Showing 8 changed files with 521 additions and 801 deletions.
15 changes: 9 additions & 6 deletions src/TwitchLib.Communication.Tests/TcpClientTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Threading;
using System.Threading.Tasks;
using TwitchLib.Communication.Clients;
using TwitchLib.Communication.Events;
using TwitchLib.Communication.Models;
using Xunit;
Expand All @@ -9,7 +10,7 @@ namespace TwitchLib.Communication.Tests
public class TcpClientTests
{
[Fact]
public void ClientRaisesOnConnectedEventArgs()
public void Client_Raises_OnConnected_EventArgs()
{

var client = new TcpClient();
Expand All @@ -27,7 +28,7 @@ public void ClientRaisesOnConnectedEventArgs()
}

[Fact]
public void ClientRaisesOnDisconnected()
public void Client_Raises_OnDisconnected_EventArgs()
{
var client = new TcpClient(new ClientOptions() {DisconnectWait = 100});
var pauseDisconnected = new ManualResetEvent(false);
Expand All @@ -39,6 +40,7 @@ public void ClientRaisesOnDisconnected()
{
client.OnConnected += async (sender, e) =>
{
await Task.Delay(2000);
client.Close();
};
client.OnDisconnected += (sender, e) =>
Expand All @@ -51,7 +53,7 @@ public void ClientRaisesOnDisconnected()
}

[Fact]
public void ClientRaisesOnReconnectedEventArgs()
public void Client_Raises_OnReconnected_EventArgs()
{
var client = new TcpClient(new ClientOptions(){ReconnectionPolicy = null});
var pauseReconnected = new ManualResetEvent(false);
Expand All @@ -63,6 +65,7 @@ public void ClientRaisesOnReconnectedEventArgs()
{
client.OnConnected += async (s, e) =>
{
await Task.Delay(2000);
client.Reconnect();
};
Expand All @@ -74,14 +77,14 @@ public void ClientRaisesOnReconnectedEventArgs()
}

[Fact]
public void DisposeClientBeforeConnecting_IsOK()
public void Dispose_Client_Before_Connecting_IsOK()
{
var tcpClient = new TcpClient();
tcpClient.Dispose(false);
tcpClient.Dispose();
}

[Fact]
public void ClientCanSendAndReceiveMessages()
public void Client_Can_SendAndReceive_Messages()
{
var client = new TcpClient();
var pauseConnected = new ManualResetEvent(false);
Expand Down
16 changes: 8 additions & 8 deletions src/TwitchLib.Communication.Tests/WebSocketClientTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Threading;
using System.Threading.Tasks;
using TwitchLib.Communication.Clients;
using TwitchLib.Communication.Events;
using TwitchLib.Communication.Models;
using Xunit;
Expand All @@ -9,9 +10,8 @@ namespace TwitchLib.Communication.Tests
public class WebSocketClientTests
{
[Fact]
public void ClientRaisesOnConnectedEventArgs()
public void Client_Raises_OnConnected_EventArgs()
{

var client = new WebSocketClient();
var pauseConnected = new ManualResetEvent(false);

Expand All @@ -27,7 +27,7 @@ public void ClientRaisesOnConnectedEventArgs()
}

[Fact]
public void ClientRaisesOnDisconnected()
public void Client_Raises_OnDisconnected_EventArgs()
{
var client = new WebSocketClient(new ClientOptions() {DisconnectWait = 5000});
var pauseDisconnected = new ManualResetEvent(false);
Expand All @@ -52,7 +52,7 @@ public void ClientRaisesOnDisconnected()
}

[Fact]
public void ClientRaisesOnReconnectedEventArgs()
public void Client_Raises_OnReconnected_EventArgs()
{
var client = new WebSocketClient(new ClientOptions(){ReconnectionPolicy = null});
var pauseReconnected = new ManualResetEvent(false);
Expand All @@ -75,15 +75,15 @@ public void ClientRaisesOnReconnectedEventArgs()
}

[Fact]
public void DisposeClientBeforeConnecting_IsOK()
public void Dispose_Client_Before_Connecting_IsOK()
{
var tcpClient = new WebSocketClient();
tcpClient.Dispose();
var client = new WebSocketClient();
client.Dispose();
}


[Fact]
public void ClientCanSendAndReceiveMessages()
public void Client_Can_SendAndReceive_Messages()
{
var client = new WebSocketClient();
var pauseConnected = new ManualResetEvent(false);
Expand Down
Loading

0 comments on commit 5b98f26

Please sign in to comment.