-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCitpPinfPacketTests.cs
52 lines (46 loc) · 1.77 KB
/
CitpPinfPacketTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using LXProtocols.Citp.Packets.Msex;
using LXProtocols.Citp.Packets;
using System.IO;
using LXProtocols.Citp.IO;
using LXProtocols.Citp.Sockets;
using LXProtocols.Citp.Packets.PInf;
namespace LXProtocols.Citp.Test
{
/// <summary>
/// Tests for the Peer Information packets
/// </summary>
[TestClass]
public class CitpPinfPacketTests
{
/// <summary>
/// Citps the msex client information test.
/// </summary>
[TestMethod, TestCategory("CitpPinf")]
public void CitpPInfPeerNameTest()
{
CitpPInfPeerName sentPacket = new CitpPInfPeerName();
sentPacket.Name = "Zaphod";
CitpPInfPeerName receivedPacket = CitpPacketTester.SendAndReceivePeerInformationPacket(sentPacket) as CitpPInfPeerName;
Assert.AreEqual(sentPacket.Name, receivedPacket.Name);
}
/// <summary>
/// Citps the msex client information test.
/// </summary>
[TestMethod, TestCategory("CitpPinf")]
public void CitpPInfPeerLocationTest()
{
CitpPInfPeerLocation sentPacket = new CitpPInfPeerLocation();
sentPacket.ListeningTCPPort = 0;
sentPacket.Type = "LightingConsole";
sentPacket.Name = "Avolites Titan";
sentPacket.State = "Running";
CitpPInfPeerLocation receivedPacket = CitpPacketTester.SendAndReceivePeerInformationPacket(sentPacket) as CitpPInfPeerLocation;
Assert.AreEqual(sentPacket.ListeningTCPPort, receivedPacket.ListeningTCPPort);
Assert.AreEqual(sentPacket.Name, receivedPacket.Name);
Assert.AreEqual(sentPacket.State, receivedPacket.State);
}
}
}