Ejemplo n.º 1
0
        public void CompactResponse()
        {
            TrackerResponse tr = new TrackerResponse(CreateTestResponseString());

            Assert.AreEqual(1, tr.NumberOfSeeds);
            Assert.AreEqual(2, tr.NumberOfLeechers);
        }
Ejemplo n.º 2
0
 public void FailureMessage()
 {
     TrackerResponse response = new TrackerResponse(new ByteString("HTTP/1.0 200 OK\r\n\r\n" +
                             "d14:failure reason56:unsupported tracker protocol, please upgrade your cliente"));
     Assert.IsFalse(response.IsSuccessful);
     Assert.AreEqual(response.FailureReason, "unsupported tracker protocol, please upgrade your client");
 }
Ejemplo n.º 3
0
        public void FailureMessage()
        {
            TrackerResponse response = new TrackerResponse(new ByteString("HTTP/1.0 200 OK\r\n\r\n" +
                                                                          "d14:failure reason56:unsupported tracker protocol, please upgrade your cliente"));

            Assert.IsFalse(response.IsSuccessful);
            Assert.AreEqual(response.FailureReason, "unsupported tracker protocol, please upgrade your client");
        }
Ejemplo n.º 4
0
 public void CompactResponseAddresses()
 {
     TrackerResponse tr = new TrackerResponse(CreateTestResponseString());
     Assert.AreEqual(IPAddress.Parse("127.0.0.1"), tr.Peers[0].IpAddress);
     Assert.AreEqual(6881, tr.Peers[0].Port);
     Assert.AreEqual(IPAddress.Parse("207.142.131.248"), tr.Peers[1].IpAddress);
     Assert.AreEqual(6882, tr.Peers[1].Port);
     Assert.AreEqual(IPAddress.Parse("105.100.107.120"), tr.Peers[2].IpAddress);
     Assert.AreEqual(6883, tr.Peers[2].Port);
 }
Ejemplo n.º 5
0
        public void CompactResponseAddresses()
        {
            TrackerResponse tr = new TrackerResponse(CreateTestResponseString());

            Assert.AreEqual(IPAddress.Parse("127.0.0.1"), tr.Peers[0].IpAddress);
            Assert.AreEqual(6881, tr.Peers[0].Port);
            Assert.AreEqual(IPAddress.Parse("207.142.131.248"), tr.Peers[1].IpAddress);
            Assert.AreEqual(6882, tr.Peers[1].Port);
            Assert.AreEqual(IPAddress.Parse("105.100.107.120"), tr.Peers[2].IpAddress);
            Assert.AreEqual(6883, tr.Peers[2].Port);
        }
Ejemplo n.º 6
0
 public void CompactResponse()
 {
     TrackerResponse tr = new TrackerResponse(CreateTestResponseString());
     Assert.AreEqual(1, tr.NumberOfSeeds);
     Assert.AreEqual(2, tr.NumberOfLeechers);
 }