コード例 #1
0
        public void SimpleFilterStringValueSerializationTest()
        {
            //Arrange
            var filter = new Filter("search", "Sushi Santa Monica");

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

            //Assert
            Assert.AreEqual("Sushi Santa Monica", result);
        }
コード例 #2
0
        public void MultipleFiltersTest()
        {
            // Arrange
            var filter = new RowFilter("name", "$bw", "Star");
            var filter2 = new Filter("include_count", "true");

            // 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 SimpleFilterIntegerValueSerializationTest()
        {
            //Arrange
            var filter = new Filter("limit", 24);

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

            //Assert
            Assert.AreEqual("24", result);
        }