コード例 #1
0
        public void GetFilterSerializationTest()
        {
            // Arrange
            var filter = new GeoFilter(34.06021, -118.41828,5000);

            // Act
            var result = JsonConvert.SerializeObject(filter);

            // Assert
            Assert.AreEqual("{\"$circle\":{\"$center\":[34.06021,-118.41828],\"$meters\":5000}}", result);
        }
コード例 #2
0
        public void GeoAndRowFilterTest()
        {
            // Arrange
            var filter = new RowFilter("name", "Stand");
            var filter2 = new GeoFilter(34.06018, -118.41835, 5000);

            // Act
            string result = Factual.Query("t/restaurants-us", filter, filter2);
            dynamic json = JsonConvert.DeserializeObject(result);

            // Assert
            Assert.AreEqual("ok", (string)json.status);
        }
コード例 #3
0
        public void QueryWithGeoFilter()
        {
            // Arrange
            var filter = new GeoFilter(34.06018, -118.41835, 500);

            // Act
            string result = Factual.Query("t/global", filter);
            dynamic json = JsonConvert.DeserializeObject(result);

            // Assert
            Assert.AreEqual("ok", (string)json.status);
        }