Inheritance Hierarchy
DeltaEngine.Networking.Tests.Tcp ConnectToOnlineServerTests
Namespace: DeltaEngine.Networking.Tests.Tcp
Assembly: DeltaEngine.Networking.Tests (in DeltaEngine.Networking.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The ConnectToOnlineServerTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ConnectToOnlineServerTests | Initializes a new instance of the ConnectToOnlineServerTests class |
Methods
Examples
[Test] public void ShouldBeConnected() { Assert.IsTrue(connection.IsConnected); }
[Test] public void SendingNullMessagesIsNotAllowed() { Assert.Throws<ArgumentNullException>(() => SendMessageAndWaitForServerResponse(null)); }
[Test] public void SendMessageWithoutLoginCausesServerError() { SendMessageAndWaitForServerResponse(new LogInfoMessage("Hi")); Assert.IsInstanceOf<ServerError>(serverResponse); }
[Test] public void LoginWithoutApiKeyShouldFail() { SendMessageAndWaitForServerResponse(new LoginRequest("", "")); Assert.IsInstanceOf<ServerError>(serverResponse); }
[Test] public void SendInvalidMessageShouldBeRejectedByServer() { Login(); SendMessageAndWaitForServerResponse(new Vector2D(0, 1)); Thread.Sleep(50); Assert.IsInstanceOf<SetProject>(serverResponse); }
[Test] public void SendLogMessageAfterLoginDoesNotCauseServerError() { Login(); connection.Send(new LogInfoMessage("Hi Server")); Assert.IsNotInstanceOf<ServerError>(serverResponse); }
See Also