using System;
using System.Collections.Generic;
using System.Text;

namespace Administration
{
    class Test
    {
        public void test()
        {
            Message a = new Message(MessageType.MT_REQUEST, "pokus", AnswerKind.AK_OK);
            a["pole_count"] = "2";
            a["pole_1"] = "1";
            a["pole_2"] = "2";

            BigRequest request = new BigRequest();
            request.inner[0] = new BigRequest.InnerClass();
            request.inner[0].ahoj = 1;
            request.inner[0].nazdar = "nazdarValue";
            request.inner[1] = new BigRequest.InnerClass();
            request.inner[1].ahoj = 2;
            request.inner[1].nazdar = "nazdar2Value";
            string big = ClientCommunicator.EncodeMessage(request);
            string cripbig = big.Substring(4);
            ProtocolReader reader = new ProtocolReader();

            BigRequest2 request2 = new BigRequest2();
            request2.inner = new BigRequest2.InnerClass();
            request2.inner.ahoj = 1;
            request2.inner.nazdar = "nazdarValue";

            string big2 = ClientCommunicator.EncodeMessage(request2);

            BigRequest answer = ClientCommunicator.DecodeMessage<BigRequest>(reader.TranslateMessage(cripbig));
            string newbig = ClientCommunicator.EncodeMessage(answer);

            if (big == newbig)
            {
                Console.Write("AA");
            }
        }
    }
}
