示例#1
0
        public void Inheritance()
        {
            var mapper = new AttributesMappingManager();
            var ser    = new SolrDocumentSerializer <TestDocWithString>(mapper, new DefaultFieldSerializer());
            var doc    = new InheritedDoc {
                Desc  = "Description",
                Desc1 = "Description1"
            };
            string fs = ser.Serialize(doc, null).ToString(SaveOptions.DisableFormatting);

            Assert.Equal(@"<doc><field name=""Desc1"">Description1</field><field name=""Desc"">Description</field></doc>", fs);
        }
 public void Inheritance()
 {
     var mapper = new AttributesMappingManager();
     var ser = new SolrDocumentSerializer<TestDocWithString>(mapper, new DefaultFieldSerializer());
     var doc = new InheritedDoc {
         Desc = "Description",
         Desc1 = "Description1"
     };
     string fs = ser.Serialize(doc, null).OuterXml;
     var xml = new XmlDocument();
     xml.LoadXml(fs);
     Console.WriteLine(fs);
     Assert.AreEqual(@"<doc><field name=""Desc1"">Description1</field><field name=""Desc"">Description</field></doc>", fs);
 }
示例#3
0
        public void Inheritance()
        {
            var mapper = new AttributesMappingManager();
            var ser    = new SolrDocumentSerializer <TestDocWithString>(mapper, new DefaultFieldSerializer());
            var doc    = new InheritedDoc {
                Desc  = "Description",
                Desc1 = "Description1"
            };
            string fs  = ser.Serialize(doc, null).OuterXml;
            var    xml = new XmlDocument();

            xml.LoadXml(fs);
            Console.WriteLine(fs);
            Assert.AreEqual(@"<doc><field name=""Desc1"">Description1</field><field name=""Desc"">Description</field></doc>", fs);
        }
 public void Inheritance() {
     var mapper = new AttributesMappingManager();
     var ser = new SolrDocumentSerializer<TestDocWithString>(mapper, new DefaultFieldSerializer());
     var doc = new InheritedDoc {
         Desc = "Description",
         Desc1 = "Description1"
     };
     string fs = ser.Serialize(doc, null).ToString(SaveOptions.DisableFormatting);
     Assert.AreEqual(@"<doc><field name=""Desc1"">Description1</field><field name=""Desc"">Description</field></doc>", fs);
 }