コード例 #1
0
        public void RectangleSerializationTest()
        {
            const string result =
                @"<RectangleDynamicKnownTypeSample>
  <Rect>
    <Left>10</Left>
    <Top>20</Top>
    <Width>30</Width>
    <Height>40</Height>
  </Rect>
</RectangleDynamicKnownTypeSample>";
            var    serializer = new YAXSerializer(typeof(RectangleDynamicKnownTypeSample), YAXExceptionHandlingPolicies.DoNotThrow, YAXExceptionTypes.Warning, YAXSerializationOptions.SerializeNullObjects);
            string got        = serializer.Serialize(RectangleDynamicKnownTypeSample.GetSampleInstance());

            Assert.That(got, Is.EqualTo(result));
        }
コード例 #2
0
        public void DesRectangleDynamicKnownTypeSample()
        {
            var obj = RectangleDynamicKnownTypeSample.GetSampleInstance();

            PerformTest(obj);
        }