public void ShouldHandleIgnoreNullValuesSetting()
        {
            ParentSampleData data = new ParentSampleData() {
                Id = 1,
                Description = "foo",
                SampleChildClass = null
            };

            XDocument xDoc = data.ConvertToXml(new XmlConvertSettings() { NullValueHandling = NullValueHandling.Ignore });
            var expected = string.Format("<ParentSampleData>\r\n  " +
                                         "<Id>1</Id>\r\n  " +
                                         "<Description>foo</Description>\r\n" +
                                         "</ParentSampleData>");
            xDoc.ToString().ShouldEqualWithDiff(expected);
        }
 public void ShouldWorkWithComplexTypePropertyWithNullReference()
 {
     ParentSampleData data = new ParentSampleData() {
         Id = 1,
         Description = "foo",
     };
     XDocument xDoc = data.ConvertToXml();
     var expected = string.Format("<ParentSampleData>\r\n  " +
                                  "<SampleChildClass>" +
                                  "</SampleChildClass>\r\n  " +
                                  "<Id>1</Id>\r\n  " +
                                  "<Description>foo</Description>\r\n" +
                                  "</ParentSampleData>");
     xDoc.ToString().ShouldEqualWithDiff(expected);
 }