예제 #1
0
        public void ToXml_ValidStruct_ReturnsXmlString()
        {
            var catalog = new SampleStruct
            {
                Count     = 50,
                FirstName = "Pablo",
                LastName  = "Duartes",
                Time      = DateTime.Now
            };

            string xml = XSerializer.ToXml(catalog);

            Assert.IsTrue(xml.IndexOf("SampleStruct") > 0);
        }
예제 #2
0
        public void BuildXmlSerializer_StructType_ReturnsXmlSerializer()
        {
            var stru = new SampleStruct
            {
                Count     = 5,
                FirstName = "Bob",
                LastName  = "Marly",
                Time      = DateTime.Now,
            };

            XmlSerializer ser = XSerializer.BuildXmlSerializer(stru);

            Assert.IsNotNull(ser);
        }