public void ActivityScheduledQueryToFormattedShouldFormat()
        {
            const string Expected = @"ActivityScheduledQuery
            {
            ActivityName: ActivityName
            ChildActivityName: ChildActivityName
            QueryAnnotations
            {
            Annotation1: Annotation 1
            Annotation2: Annotation 2
            }
            }
            ";

            // Arrange
            var asq = new ActivityScheduledQuery
                {
                    ActivityName = "ActivityName",
                    ChildActivityName = "ChildActivityName",
                    QueryAnnotations = {
                                          { "Annotation1", "Annotation 1" }, { "Annotation2", "Annotation 2" }
                                       }
                };

            // Act
            var actual = asq.ToFormattedString();

            // Assert
            Assert.AreEqual(Expected, actual);
        }
        private ActivityScheduledQuery Match(ActivityScheduledRecord activityScheduledRecord)
        {
            ActivityScheduledQuery query = null;

            if (this.activityScheduledSubscriptions != null)
            {
                for (int i = 0; i < this.activityScheduledSubscriptions.Count; i++)
                {
                    string strB = (activityScheduledRecord.Activity == null) ? null : activityScheduledRecord.Activity.Name;
                    if (string.CompareOrdinal(this.activityScheduledSubscriptions[i].ActivityName, strB) == 0)
                    {
                        if (!CheckSubscription(this.activityScheduledSubscriptions[i].ChildActivityName, activityScheduledRecord.Child.Name))
                        {
                            continue;
                        }
                        query = this.activityScheduledSubscriptions[i];
                        break;
                    }
                    if ((string.CompareOrdinal(this.activityScheduledSubscriptions[i].ActivityName, "*") == 0) && CheckSubscription(this.activityScheduledSubscriptions[i].ChildActivityName, activityScheduledRecord.Child.Name))
                    {
                        query = this.activityScheduledSubscriptions[i];
                        break;
                    }
                }
            }
            if (((query == null) || (this.associatedProfile.ImplementationVisibility != ImplementationVisibility.RootScope)) || (this.ShouldTrackActivity(activityScheduledRecord.Activity, query.ActivityName) && this.ShouldTrackActivity(activityScheduledRecord.Child, query.ChildActivityName)))
            {
                return(query);
            }
            return(null);
        }
 private void AddActivityScheduledSubscription(ActivityScheduledQuery activityScheduledQuery)
 {
     this.trackingRecordPreFilter.TrackActivityScheduledRecords = true;
     if (this.activityScheduledSubscriptions == null)
     {
         this.activityScheduledSubscriptions = new List<ActivityScheduledQuery>();
     }
     this.activityScheduledSubscriptions.Add(activityScheduledQuery);
 }
Beispiel #4
0
 private void AddActivityScheduledSubscription(ActivityScheduledQuery activityScheduledQuery)
 {
     this.trackingRecordPreFilter.TrackActivityScheduledRecords = true;
     if (this.activityScheduledSubscriptions == null)
     {
         this.activityScheduledSubscriptions = new List <ActivityScheduledQuery>();
     }
     this.activityScheduledSubscriptions.Add(activityScheduledQuery);
 }
Beispiel #5
0
        private ActivityScheduledQuery Match(ActivityScheduledRecord activityScheduledRecord)
        {
            ActivityScheduledQuery query = null;

            if (this.activityScheduledSubscriptions != null)
            {
                for (var i = 0; i < this.activityScheduledSubscriptions.Count; i++)
                {
                    //check specific and then generic
                    var activityName = activityScheduledRecord.Activity == null ? null : activityScheduledRecord.Activity.Name;
                    if (string.CompareOrdinal(this.activityScheduledSubscriptions[i].ActivityName, activityName) == 0)
                    {
                        if (CheckSubscription(this.activityScheduledSubscriptions[i].ChildActivityName, activityScheduledRecord.Child.Name))
                        {
                            query = this.activityScheduledSubscriptions[i];
                            break;
                        }
                    }
                    else if (string.CompareOrdinal(this.activityScheduledSubscriptions[i].ActivityName, "*") == 0)
                    {
                        if (CheckSubscription(this.activityScheduledSubscriptions[i].ChildActivityName, activityScheduledRecord.Child.Name))
                        {
                            query = this.activityScheduledSubscriptions[i];
                            break;
                        }
                    }
                }
            }

            if ((query != null) && (this.associatedProfile.ImplementationVisibility == ImplementationVisibility.RootScope))
            {
                if ((!ShouldTrackActivity(activityScheduledRecord.Activity, query.ActivityName)) ||
                    (!ShouldTrackActivity(activityScheduledRecord.Child, query.ChildActivityName)))
                {
                    return(null);
                }
            }

            return(query);
        }