示例#1
0
        public void ShouldHaveDataAfterWithDataAndXmlSerializationWithGenericOtherType()
        {
            TestData data = new TestData {
                IsTest = true
            };
            Message testMsg = Message.Create().WithData(data, SerializationType.Xml);

            Assert.IsNotNull(testMsg);
            OtherTestData actualData = testMsg.GetData <OtherTestData>();

            Assert.AreEqual(data.IsTest, actualData.IsTest);
        }
示例#2
0
        public void ShouldHaveDataAfterWithDataAndJsonSerializationWithPassedOtherType()
        {
            TestData data = new TestData {
                IsTest = true
            };
            Message testMsg = Message.Create().WithData(data, SerializationType.Json);

            Assert.IsNotNull(testMsg);
            OtherTestData actualData = (OtherTestData)testMsg.GetDataObject(typeof(OtherTestData));

            Assert.AreEqual(data.IsTest, actualData.IsTest);
        }