Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ActivityCoverageReporter"/> class.
 /// </summary>
 public ActivityCoverageReporter(CoverageInfo coverageInfo)
 {
     this.CoverageInfo = coverageInfo;
     this.BuiltInEvents.Add(typeof(GotoStateEvent).FullName);
     this.BuiltInEvents.Add(typeof(PushStateEvent).FullName);
     this.BuiltInEvents.Add(typeof(DefaultEvent).FullName);
 }
Exemple #2
0
        /// <summary>
        /// Merges the information from the specified coverage info. This is not thread-safe.
        /// </summary>
        public void Merge(CoverageInfo coverageInfo)
        {
            foreach (var machine in coverageInfo.Machines)
            {
                this.Machines.Add(machine);
            }

            foreach (var machine in coverageInfo.MachinesToStates)
            {
                foreach (var state in machine.Value)
                {
                    this.DeclareMachineState(machine.Key, state);
                }
            }

            foreach (var tup in coverageInfo.RegisteredEvents)
            {
                foreach (var e in tup.Value)
                {
                    this.InternalAddEvent(tup.Key, e);
                }
            }

            if (this.CoverageGraph == null)
            {
                this.CoverageGraph = coverageInfo.CoverageGraph;
            }
            else if (coverageInfo.CoverageGraph != null && this.CoverageGraph != coverageInfo.CoverageGraph)
            {
                this.CoverageGraph.Merge(coverageInfo.CoverageGraph);
            }

            if (this.EventInfo == null)
            {
                this.EventInfo = coverageInfo.EventInfo;
            }
            else if (coverageInfo.EventInfo != null && this.EventInfo != coverageInfo.EventInfo)
            {
                this.EventInfo.Merge(coverageInfo.EventInfo);
            }
        }