public void CreateOrUpdateStatsTest()
        {
            TransitReferrerHost host = new TransitReferrerHost();
            host.LastSource = Guid.NewGuid().ToString();
            host.LastUrl = Guid.NewGuid().ToString();
            host.Name = Guid.NewGuid().ToString();
            host.RequestCount = 1;
            host.Id = Blog.CreateOrUpdateReferrerHost(Ticket, host);

            TransitBrowser browser = new TransitBrowser();
            browser.Name = Guid.NewGuid().ToString();
            browser.Platform = Guid.NewGuid().ToString();
            browser.Version = Guid.NewGuid().ToString().Substring(0, 10);
            browser.Id = Blog.CreateOrUpdateBrowser(Ticket, browser);

            TransitReferrerSearchQuery query = new TransitReferrerSearchQuery();
            query.RequestCount = 1;
            query.SearchQuery = Guid.NewGuid().ToString();
            query.Id = Blog.CreateOrUpdateReferrerSearchQuery(Ticket, query);

            List<TransitReferrerHost> hosts = new List<TransitReferrerHost>();
            hosts.Add(host);

            List<TransitBrowser> browsers = new List<TransitBrowser>();
            browsers.Add(browser);

            List<TransitReferrerSearchQuery> queries = new List<TransitReferrerSearchQuery>();
            queries.Add(query);

            int result = Blog.CreateOrUpdateStats(Ticket, browsers.ToArray(), hosts.ToArray(), queries.ToArray());
            Assert.AreEqual(result, Math.Max(Math.Max(browsers.Count, hosts.Count), queries.Count));

            Blog.DeleteReferrerHost(Ticket, host.Id);
            Blog.DeleteBrowser(Ticket, browser.Id);
            Blog.DeleteReferrerSearchQuery(Ticket, query.Id);
        }
Exemple #2
0
 /// <remarks/>
 public void CreateOrUpdateStatsAsync(string ticket, TransitBrowser[] t_browsers, TransitReferrerHost[] t_rhs, TransitReferrerSearchQuery[] t_rsqs) {
     this.CreateOrUpdateStatsAsync(ticket, t_browsers, t_rhs, t_rsqs, null);
 }
Exemple #3
0
 /// <remarks/>
 public void CreateOrUpdateStatsAsync(string ticket, TransitBrowser[] t_browsers, TransitReferrerHost[] t_rhs, TransitReferrerSearchQuery[] t_rsqs, object userState) {
     if ((this.CreateOrUpdateStatsOperationCompleted == null)) {
         this.CreateOrUpdateStatsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrUpdateStatsOperationCompleted);
     }
     this.InvokeAsync("CreateOrUpdateStats", new object[] {
                 ticket,
                 t_browsers,
                 t_rhs,
                 t_rsqs}, this.CreateOrUpdateStatsOperationCompleted, userState);
 }
Exemple #4
0
 public int CreateOrUpdateStats(string ticket, TransitBrowser[] t_browsers, TransitReferrerHost[] t_rhs, TransitReferrerSearchQuery[] t_rsqs) {
     object[] results = this.Invoke("CreateOrUpdateStats", new object[] {
                 ticket,
                 t_browsers,
                 t_rhs,
                 t_rsqs});
     return ((int)(results[0]));
 }
Exemple #5
0
 /// <remarks/>
 public void CreateOrUpdateReferrerSearchQueryAsync(string ticket, TransitReferrerSearchQuery t_referrersearchquery, object userState) {
     if ((this.CreateOrUpdateReferrerSearchQueryOperationCompleted == null)) {
         this.CreateOrUpdateReferrerSearchQueryOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrUpdateReferrerSearchQueryOperationCompleted);
     }
     this.InvokeAsync("CreateOrUpdateReferrerSearchQuery", new object[] {
                 ticket,
                 t_referrersearchquery}, this.CreateOrUpdateReferrerSearchQueryOperationCompleted, userState);
 }
Exemple #6
0
 /// <remarks/>
 public void CreateOrUpdateReferrerSearchQueryAsync(string ticket, TransitReferrerSearchQuery t_referrersearchquery) {
     this.CreateOrUpdateReferrerSearchQueryAsync(ticket, t_referrersearchquery, null);
 }
Exemple #7
0
 public int CreateOrUpdateReferrerSearchQuery(string ticket, TransitReferrerSearchQuery t_referrersearchquery) {
     object[] results = this.Invoke("CreateOrUpdateReferrerSearchQuery", new object[] {
                 ticket,
                 t_referrersearchquery});
     return ((int)(results[0]));
 }
 public BlogReferrerSearchQueryTest()
 {
     mReferrerSearchQuery = new TransitReferrerSearchQuery();
     mReferrerSearchQuery.SearchQuery = Guid.NewGuid().ToString();
     mReferrerSearchQuery.RequestCount = 1;
 }