Ejemplo n.º 1
0
 void IMetric <T> .Add(T data)
 {
     if (_selector(data))
     {
         _metric.Add(data);
     }
 }
Ejemplo n.º 2
0
        public void Add(TBase data)
        {
            IEnumerable <TSub> subInput = _selector(data).Where(s => _filter(data, s));

            foreach (TSub subItem in subInput)
            {
                _metric.Add(subItem);
            }
        }
Ejemplo n.º 3
0
        void IResultsAggregator.TestContextResultReceived(IResult result)
        {
            foreach (ICheckpoint checkpoint in result.Checkpoints)
            {
                if (checkpoint.Error != null)
                {
                    string existingTextBoxValue = tbErrors.Text;
                    if (existingTextBoxValue.Length > 10000)
                    {
                        existingTextBoxValue = existingTextBoxValue.Substring(0, 10000);
                    }

                    string newText = $"{DateTime.Now.ToString("O")} {checkpoint.Name}\r\n{checkpoint.Error}\r\n\r\n";

                    tbErrors.Invoke(new InvokeDelegate(() => tbErrors.Text = newText + existingTextBoxValue));
                }
            }

            _metricMultiplexer.Add(result);
        }
Ejemplo n.º 4
0
        private void _backgroundWorker1_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
        {
            IResult result;

            while (_resultsQueue.TryDequeue(out result))
            {
                _metrics.Add(result);

                foreach (ICheckpoint checkpoint in result.Checkpoints)
                {
                    if (checkpoint.Error != null)
                    {
                        AppendMessage($"{checkpoint.Name}\r\n{checkpoint.Error}");
                    }
                }
            }

            string jsonResult = JsonConvert.SerializeObject(GetData(), Formatting.Indented);

            resultsTextBox.Text = jsonResult;
            RefreshWindowTitle();
        }