public void ParsingTestTimeDestination() { var udp = new UDPParser(); PPacket pack = udp.Parsing(udpPacket, time, len); Assert.AreEqual(pack.GetPacket(6), "59149"); }
public void ParsingTestTimeDestinationIp() { var udp = new UDPParser(); PPacket pack = udp.Parsing(udpPacket, time, len); Assert.AreEqual(pack.GetPacket(4), "192.168.8.100"); }
public void ParsingTestSource() { var udp = new UDPParser(); PPacket pack = udp.Parsing(udpPacket, time, len); Assert.AreEqual(pack.GetPacket(5), "443"); }
public void ParsingTestSourceIp() { var udp = new UDPParser(); PPacket pack = udp.Parsing(udpPacket, time, len); Assert.AreEqual(pack.GetPacket(3), "173.194.73.113"); }
public void ParsingTestTimeLen() { var udp = new UDPParser(); PPacket pack = udp.Parsing(udpPacket, time, len); Assert.AreEqual(pack.GetPacket(2), "62"); }
public void ParsingTestInformation() { var udp = new UDPParser(); PPacket pack = udp.Parsing(udpPacket, time, len); Assert.AreEqual(pack.GetPacket(7), "-"); }
public void ParsingTestName() { var udp = new UDPParser(); PPacket pack = udp.Parsing(udpPacket, time, len); Assert.AreEqual(pack.GetPacket(0), "UDP"); }
public void ParsingTestTime() { var udp = new UDPParser(); PPacket pack = udp.Parsing(udpPacket, time, len); Assert.AreEqual(pack.GetPacket(1), "20:18:32 473"); }
public HeaderParse(EthernetParserGenerator ep, IPv4ParserGenerator ipv4, IPv6Parser ipv6, TCPParser tcp, UDPParser udp) { this.ep = ep; this.ipv4 = ipv4; this.ipv6 = ipv6; this.tcp = tcp; this.udp = udp; }
public void UDPParserTest() { UDPParser parser = new UDPParser(); var result = parser.ParsePcapFile(@"../../../../TestFiles/test.pcap"); // Common properties Assert.That(result[0].Protocol, Is.EqualTo("UDP")); Assert.That(result[0].Length, Is.EqualTo(145)); Assert.That(result[0].DestinationAddress, Is.EqualTo("95.27.46.98")); Assert.That(result[0].DestinationPort, Is.EqualTo("58595")); Assert.That(result[0].SourceAddress, Is.EqualTo("192.168.43.156")); Assert.That(result[0].SourcePort, Is.EqualTo("60734")); Assert.That(result[0].TimeStamp.ToString("yyyy-MM-dd"), Is.EqualTo("2017-11-23")); // unusual Assert.That(result[0].Header, Is.EqualTo("Checksum : 18532\r\nPacketLength : 111\r\n")); Assert.That(result.Count, Is.EqualTo(51)); }