Beispiel #1
0
        internal static void AddTraceToTraceList(TraceDto trace)
        {
            if (TraceList.ContainsKey(trace.Writer))
            {
                TraceList[trace.Writer].Enqueue(trace);
            }
            else
            {
                var traceWriterList = new ConcurrentQueue <TraceDto>();
                traceWriterList.Enqueue(trace);
                TraceList.Add(trace.Writer, traceWriterList);
            }

            CalculateWriterSize(trace);

            SparseWriter(trace.Writer);
        }
 public string Execute(Dictionary <string, string> parameterList)
 {
     if (ExecuteFunction == null)
     {
         return("Error function, no valid function registered!");
     }
     try
     {
         var s = ExecuteFunction(parameterList);
         TraceList.Add(DateTime.UtcNow, s);
         if (TraceList.Count > TraceCount)
         {
             var d = TraceList.FirstOrDefault();
             TraceList.Remove(d.Key);
         }
         return(s);
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
 }
Beispiel #3
0
 public int ExecuteNonQuery()
 {
     ExecutorMethod = "ExecuteNonQuery";
     TraceList.Add(this);
     return(0);
 }
Beispiel #4
0
 public object ExecuteScalar()
 {
     ExecutorMethod = "ExecuteScalar";
     TraceList.Add(this);
     return(ExpectedCommandResult);
 }
Beispiel #5
0
 public DbDataReader ExecuteReader(CommandBehavior behavior)
 {
     ExecutorMethod = $"ExecuteReader(CommandBehavior.{behavior})";
     TraceList.Add(this);
     return((TestDataReader)ExpectedCommandResult);
 }
Beispiel #6
0
 public DbDataReader ExecuteReader()
 {
     ExecutorMethod = "ExecuteReader";
     TraceList.Add(this);
     return((TestDataReader)ExpectedCommandResult);
 }