public void Serializable()
        {
            //IObjectMessage message = (IObjectMessage)mocks.CreateMock(typeof(IObjectMessage));

            SerializableWithAttribute content = new SerializableWithAttribute();

            ObjectMessage message = new ObjectMessage(tibcoSession, content);
            Expect.Call(session.CreateObjectMessage(content)).Return(message).Repeat.Once();

            //Expect.Call(message.TheObject).Return(content).Repeat.Once();

            mocks.ReplayAll();


            Message msg = converter.ToMessage(content, session);
            Assert.AreEqual(content, converter.FromMessage(message));
            
            mocks.VerifyAll();
        }
        public void ToMessageSimplyReturnsMessageAsIsIfSuppliedWithMessage()
        {
            SerializableWithAttribute content = new SerializableWithAttribute();

            ObjectMessage message = new ObjectMessage(tibcoSession, content);

            mocks.ReplayAll();

            Message msg = converter.ToMessage(message, session);
            Assert.AreSame(message, msg);

            mocks.VerifyAll();
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Extracts the serializable object from the given object message.
 /// </summary>
 /// <param name="message">The message to convert.</param>
 /// <returns>The resulting serializable object.</returns>
 protected virtual object ExtractSerializableFromMessage(
     ObjectMessage message)
 {
     return message.TheObject;
 }