Example #1
0
        public void Location()
        {
            var mapper  = new AttributesMappingManager();
            var ser     = new SolrDocumentSerializer <TestDocWithLocation>(mapper, new DefaultFieldSerializer());
            var testDoc = new TestDocWithLocation {
                Loc = new Location(12.2, -12.3)
            };
            string fs = ser.Serialize(testDoc, null).ToString(SaveOptions.DisableFormatting);

            Assert.Equal(@"<doc><field name=""location"">12.2,-12.3</field></doc>", fs);
        }
        public void Location()
        {
            var mapper  = new AttributesMappingManager();
            var ser     = new SolrDocumentSerializer <TestDocWithLocation>(mapper, new DefaultFieldSerializer());
            var testDoc = new TestDocWithLocation {
                Loc = new Location(12.2, -12.3)
            };
            string fs  = ser.Serialize(testDoc, null).OuterXml;
            var    xml = new XmlDocument();

            xml.LoadXml(fs);
            Console.WriteLine(fs);
            Assert.AreEqual(@"<doc><field name=""location"">12.2,-12.3</field></doc>", fs);
        }
 public void Location() {
     var mapper = new AttributesMappingManager();
     var ser = new SolrDocumentSerializer<TestDocWithLocation>(mapper, new DefaultFieldSerializer());
     var testDoc = new TestDocWithLocation { Loc = new Location(12.2, -12.3) };
     string fs = ser.Serialize(testDoc, null).ToString(SaveOptions.DisableFormatting);
     Assert.AreEqual(@"<doc><field name=""location"">12.2,-12.3</field></doc>", fs);
 }
 public void Location()
 {
     var mapper = new AttributesMappingManager();
     var ser = new SolrDocumentSerializer<TestDocWithLocation>(mapper, new DefaultFieldSerializer());
     var testDoc = new TestDocWithLocation { Loc = new Location(12.2, -12.3) };
     string fs = ser.Serialize(testDoc, null).OuterXml;
     var xml = new XmlDocument();
     xml.LoadXml(fs);
     Console.WriteLine(fs);
     Assert.AreEqual(@"<doc><field name=""location"">12.2,-12.3</field></doc>", fs);
 }