Exemplo n.º 1
0
        public void Msg_Clone_GetConfigAck()
        {
            GetConfigAck msgIn, msgOut;

            msgOut = new GetConfigAck(new Exception("Test exception"));
            msgIn  = (GetConfigAck)msgOut.Clone();

            Assert.AreEqual(msgOut.Exception, msgIn.Exception);
            Assert.AreEqual(msgOut.ConfigText, msgIn.ConfigText);

            msgOut = new GetConfigAck("config info");
            msgIn  = (GetConfigAck)msgOut.Clone();

            Assert.AreEqual(msgOut.Exception, msgIn.Exception);
            Assert.AreEqual(msgOut.ConfigText, msgIn.ConfigText);

            TestBaseCloning(msgOut);
        }
Exemplo n.º 2
0
        public void Msg_Serialize_GetConfigAck()
        {
            GetConfigAck   msgIn, msgOut;
            EnhancedStream es = new EnhancedMemoryStream();

            msgOut = new GetConfigAck(new Exception("Test exception"));

            Msg.Save(es, msgOut);
            es.Seek(0, SeekOrigin.Begin);
            msgIn = (GetConfigAck)Msg.Load(es);

            Assert.AreEqual("Test exception", msgIn.Exception);
            Assert.IsNull(msgIn.ConfigText);

            msgOut = new GetConfigAck("config info");
            es.SetLength(0);
            Msg.Save(es, msgOut);
            es.Seek(0, SeekOrigin.Begin);
            msgIn = (GetConfigAck)Msg.Load(es);

            Assert.IsNull(msgIn.Exception);
            Assert.AreEqual("config info", msgIn.ConfigText);
        }