예제 #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);
        }