Пример #1
0
        public void FacetLimitParameter001()
        {
            // Arrange
            var container = new List <string>();
            var parameter = new FacetLimitParameter <TestDocument>();

            parameter.Configure(10);

            // Act
            parameter.Execute(container);

            // Assert
            Assert.Equal(1, container.Count);
            Assert.Equal("facet.limit=10", container[0]);
        }
        public void FacetLimitParameter001()
        {
            // Arrange
            var    expected = JObject.Parse(@"
            {
              params:{
                ""facet.limit"":10
              }
            }");
            string actual;
            var    jObject   = new JObject();
            var    parameter = new FacetLimitParameter <TestDocument>();

            parameter.Configure(10);

            // Act
            parameter.Execute(jObject);
            actual = jObject.ToString();

            // Assert
            Assert.Equal(expected.ToString(), actual);
        }