コード例 #1
0
ファイル: WriteXmlTests.cs プロジェクト: JohanLarsson/Gu.Xml
        public void MappedWithNullable()
        {
            var classWithNullable = new MappedWithNullable();
            var xml      = classWithNullable.ToXml();
            var expected = @"<?xml version=""1.0"" encoding=""utf-16""?>
<MappedWithNullable />";

            Assert.AreEqual(expected, xml);
        }
コード例 #2
0
        public void MappedWithNullableWithValues()
        {
            var instance = new MappedWithNullable {
                Value1 = 1, Value2 = 2
            };
            var roundtrip = instance.Roundtrip();

            Assert.AreEqual(instance.Value1, roundtrip.Value1);
            Assert.AreEqual(instance.Value2, roundtrip.Value2);
        }