Example #1
0
        public void simple_query_for_all_field_of_episode()
        {
            var query  = TestHelper.CreateQuery <Episode>();
            var result = QueryParserFactory
                         .Create(query)
                         .Parse();

            Assert.Equal("query GetEpisode{Author,Id,Name}", result);
        }
Example #2
0
        public void simple_query_for_all_field_of_basemodel()
        {
            var query  = TestHelper.CreateQuery <BaseModel>();
            var result = QueryParserFactory
                         .Create(query)
                         .Parse();

            Assert.Equal("query GetBaseModel{Id}", result);
        }
Example #3
0
        public void queryparser_query_name_condition()
        {
            var query  = TestHelper.CreateQuery <BaseModel>();
            var result = QueryParserFactory
                         .Create(query)
                         .Parse();

            Assert.Contains("GetBaseModel", result);
        }
Example #4
0
        public void queryparser_query_return()
        {
            var query  = TestHelper.CreateQuery <BaseModel>();
            var result = QueryParserFactory
                         .Create(query)
                         .Parse();

            Assert.Contains("query", result);
        }
Example #5
0
        public void simple_query_with_select_of_person()
        {
            var query = TestHelper.CreateQuery <Episode>()
                        .Select(x => new { x.Id, x.Author.Name });
            var result = QueryParserFactory
                         .Create(query)
                         .Parse();

            Assert.Equal("query GetEpisode{Author{Name},Id}", result);
        }
Example #6
0
 public void queryparser_argument_exception()
 {
     Assert.Throws <ArgumentNullException>(() => QueryParserFactory.Create(null));
 }
Example #7
0
 public void queryparser_string_return()
 {
     QueryParserFactory.Create(TestHelper.CreateQuery <BaseModel>());
 }