public void GenerateNoMaxValuesTest()
 {
     GBaseQuery query = new GBaseQuery(BaseUrl);
     query.MaxValues = 0;
     Assert.AreEqual(BaseUrl + "?max-values=0",
                     query.Uri.ToString());
 }
        private void Execute(string[] args)
        {
            string queryString = null;

            if (args.Length == 3)
            {
                args = Init(args, "Google-CsharpQueryExample-1.0");
                queryString = args[0];
            }
            else 
            {
                FatalError("Invalid argument count. Usage:\n" +
                           "  queryexample.exe --key <key> \"<query>\"");
            }

            // Creates a query on the snippets feed.
            GBaseQuery query = new GBaseQuery(uriFactory.SnippetsFeedUri);
            query.GoogleBaseQuery = queryString;
            query.NumberToRetrieve = MAX_RESULTS;

            System.Console.WriteLine("Sending request to: " + query.Uri);

            // Connects to the server and gets the result, which is
            // then parsed to create a GBaseFeed object.
            GBaseFeed result = service.Query(query);

            PrintResult(result);
        }
 public void GenerateBqTest()
 {
     GBaseQuery query = new GBaseQuery(BaseUrl);
     query.GoogleBaseQuery = "hello";
     Assert.AreEqual(BaseUrl + "?bq=hello",
                     query.Uri.ToString());
 }
 public void GenerateOrderByTest()
 {
     GBaseQuery query = new GBaseQuery(BaseUrl);
     query.OrderBy = "test";
     Assert.AreEqual(BaseUrl + "?orderby=test",
                     query.Uri.ToString());
 }
 private GBaseQuery Parse(string parameters)
 {
     GBaseQuery query = new GBaseQuery();;
     query.Uri = new Uri(BaseUrl + parameters);
     return query;
 }
        public void GenerateContentTest()
        {
            GBaseQuery query = new GBaseQuery(BaseUrl);
            query.Content = "test";
            Assert.AreEqual(BaseUrl + "?content=test",
                            query.Uri.ToString());

        }
 public void GenerateRefineTest()
 {
     GBaseQuery query = new GBaseQuery(BaseUrl);
     query.Refine = true;
     Assert.AreEqual(BaseUrl + "?refine=true",
                     query.Uri.ToString());
     query.Refine = false;
     Assert.AreEqual(BaseUrl,
                     query.Uri.ToString());
 }
 public void GenerateSortOrderTest()
 {
     GBaseQuery query = new GBaseQuery(BaseUrl);
     query.AscendingOrder = true;
     Assert.AreEqual(BaseUrl + "?sortorder=ascending",
                     query.Uri.ToString());
     query.AscendingOrder = false;
     Assert.AreEqual(BaseUrl,
                     query.Uri.ToString());
 }
 ///////////////////////////////////////////////////////////////////////
 /// <summary>Executes a Google Base Query</summary>
 /// <param name="feedQuery">the query to run</param>
 /// <returns>the feed returned by the server</returns>
 ///////////////////////////////////////////////////////////////////////
 public GBaseFeed Query(GBaseQuery feedQuery)
 {
     return Query((FeedQuery)feedQuery) as GBaseFeed;
 }
 ///////////////////////////////////////////////////////////////////////
 /// <summary>Executes a Google Base Query</summary>
 /// <param name="feedQuery">the query to run</param>
 /// <returns>the feed returned by the server</returns>
 ///////////////////////////////////////////////////////////////////////
 public GBaseFeed Query(GBaseQuery feedQuery)
 {
     return(Query((FeedQuery)feedQuery) as GBaseFeed);
 }
        public void Execute()
        {
            GBaseQuery query = new GBaseQuery(uriFactory.ItemsFeedUri);
            query.GoogleBaseQuery = queryString;

            WriteToStandardOutput(service.Query(query));
        }