Exemplo n.º 1
0
        public void Eio3NullNamespaceNullQuery()
        {
            var    handler = new Eio3Handler();
            string message = handler.CreateConnectionMessage(null, null);

            Assert.AreEqual("40", message);
        }
Exemplo n.º 2
0
        public void Eio3NullNamespaceEmptyQuery()
        {
            var    handler = new Eio3Handler();
            string message = handler.CreateConnectionMessage(null, new Dictionary <string, string>());

            Assert.AreEqual("40", message);
        }
Exemplo n.º 3
0
        public void NullNamespaceNullText()
        {
            var handler = new Eio3Handler();
            var result  = handler.CheckConnection(null, null);

            Assert.IsFalse(result.Result);
            Assert.IsNull(result.Id);
        }
Exemplo n.º 4
0
        public void CorrectNamespaceTextEndsWithoutComma()
        {
            var handler = new Eio3Handler();
            var result  = handler.CheckConnection("/test", "/test");

            Assert.IsTrue(result.Result);
            Assert.IsNull(result.Id);
        }
Exemplo n.º 5
0
        public void WrongNamespace()
        {
            var handler = new Eio3Handler();
            var result  = handler.CheckConnection("/test", "/nsp,");

            Assert.IsFalse(result.Result);
            Assert.IsNull(result.Id);
        }
Exemplo n.º 6
0
        public void NullNamespaceEmptyText()
        {
            var handler = new Eio3Handler();
            var result  = handler.CheckConnection(null, string.Empty);

            Assert.IsTrue(result.Result);
            Assert.IsNull(result.Id);
        }
Exemplo n.º 7
0
        public void Eio3GetBytes()
        {
            var handler = new Eio3Handler();
            var bytes   = Encoding.UTF8.GetBytes("hello world!");
            var output  = handler.GetBytes(bytes);

            Assert.AreEqual(bytes.Length - 1, output.Length);
            Assert.AreEqual("ello world!", Encoding.UTF8.GetString(output));
        }
Exemplo n.º 8
0
        public void Eio3NullNamespace1Query()
        {
            var    handler = new Eio3Handler();
            string message = handler.CreateConnectionMessage(null, new Dictionary <string, string>
            {
                { "key", "val" }
            });

            Assert.AreEqual("40?key=val", message);
        }
Exemplo n.º 9
0
        public void Eio3Namespace2Query()
        {
            var    handler = new Eio3Handler();
            string message = handler.CreateConnectionMessage("/nsp", new Dictionary <string, string>
            {
                { "key", "val" },
                { "token", "V2" }
            });

            Assert.AreEqual("40/nsp?key=val&token=V2,", message);
        }