Пример #1
0
 public void windows()
 {
     spdyserver.Pack pack = new spdyserver.Pack(1);
     byte [] p = pack.windowsUpdate(1,1);
     spdyserver.Unpack un = new spdyserver.Unpack();
     un.Extract(p);
     Dictionary<string, UInt32> a = un.getheader();
     Assert.AreEqual(1, a["Size"]);
 }
Пример #2
0
 public void syn_streamHeader()
 {
     spdyserver.Pack pack = new spdyserver.Pack(1);
     Dictionary<string, string> d = new Dictionary<string, string>();
     d.Add("s1", "teste");
     d.Add("23", "teste");
     byte [] p = pack.synStream(0, 1, 0, 2, d);
     spdyserver.Unpack un = new spdyserver.Unpack();
     un.Extract(p);
     Dictionary<string, UInt32> a = un.getheader();
     Assert.AreEqual(0, a["Flag"]);
 }
Пример #3
0
 public void syn_replyBody()
 {
     spdyserver.Pack pack = new spdyserver.Pack(1);
     Dictionary<string, string> d = new Dictionary<string, string>();
     d.Add("s1", "teste");
     d.Add("23", "teste");
     byte [] p = pack.synReply(0, 1, d);
     spdyserver.Unpack un = new spdyserver.Unpack();
     un.Extract(p);
     Dictionary<string, string> a = un.getBody();
     Assert.AreEqual(a,d);
 }
Пример #4
0
 public void reset()
 {
     spdyserver.Pack pack = new spdyserver.Pack(1);
     byte [] p = pack.rstStream(0, 1, 0);
     spdyserver.Unpack un = new spdyserver.Unpack();
     un.Extract(p);
     Dictionary<string, UInt32> a = un.getheader();
     Assert.AreEqual(0, a["Status_code"]);
 }
Пример #5
0
 public void ping()
 {
     spdyserver.Pack pack = new spdyserver.Pack(1);
     byte [] p = pack.ping(1);
     spdyserver.Unpack un = new spdyserver.Unpack();
     un.Extract(p);
     Dictionary<string, UInt32> a = un.getheader();
     Assert.AreEqual(1, a["ID"]);
 }
Пример #6
0
 public void data()
 {
     spdyserver.Pack pack = new spdyserver.Pack(1);
     byte [] b = new byte [4];
     byte [] p = pack.data(1, 0, b);
     spdyserver.Unpack u = new spdyserver.Unpack();
     u.Extract(p);
     Dictionary<string, UInt32> a = u.getheader();
     Assert.AreEqual(4, a["Length"]);
 }