public string StandardSql([PexAssumeUnderTest] TraceUtilities target, string sql)
        {
            string result = target.StandardSql(sql);

            return(result);
            // TODO: add assertions to method TraceUtilitiesTest.StandardSql(TraceUtilities, String)
        }
        public TraceUtilities Constructor()
        {
            TraceUtilities target = new TraceUtilities();

            return(target);
            // TODO: add assertions to method TraceUtilitiesTest.Constructor()
        }
 public void FillRichEdit(
     [PexAssumeUnderTest] TraceUtilities target,
     RichTextBox rich,
     string value
     )
 {
     target.FillRichEdit(rich, value);
     // TODO: add assertions to method TraceUtilitiesTest.FillRichEdit(TraceUtilities, RichTextBox, String)
 }
Beispiel #4
0
        /// <summary>
        /// Appends from file.
        /// </summary>
        /// <param name="cnt">The CNT.</param>
        /// <param name="filename">The filename.</param>
        /// <param name="ignorenonamesp">if set to <c>true</c> [ignore no name SP].</param>
        /// <param name="transform">if set to <c>true</c> [transform].</param>
        public void AppendFromFile(int cnt, string filename, bool ignorenonamesp, bool transform)
        {
            XmlSerializer x  = new XmlSerializer(typeof(EventList[]));
            FileStream    fs = new FileStream(filename, FileMode.Open);

            EventList[]    a   = (EventList[])x.Deserialize(fs);
            TraceUtilities lex = new TraceUtilities();

            foreach (EventList e in a)
            {
                if (e.TextData.Contains("statman") || e.TextData.Contains("UPDATE STATISTICS"))
                {
                    continue;
                }

                if (!ignorenonamesp || e.ObjectName.Length != 0)
                {
                    if (transform)
                    {
                        this.AddEvent(
                            cnt,
                            e.DatabaseID,
                            e.DatabaseName,
                            e.ObjectName.Length == 0 ? 0 : e.ObjectID,
                            e.ObjectName.Length == 0 ? string.Empty : e.ObjectName,
                            e.ObjectName.Length == 0 ? lex.StandardSql(e.TextData) : e.TextData,
                            e.CPU,
                            e.Reads,
                            e.Writes,
                            e.Duration,
                            e.Count,
                            e.RowCounts);
                    }
                    else
                    {
                        this.AddEvent(
                            cnt,
                            e.DatabaseID,
                            e.DatabaseName,
                            e.ObjectID,
                            e.ObjectName,
                            e.TextData,
                            e.CPU,
                            e.Reads,
                            e.Writes,
                            e.Duration,
                            e.Count,
                            e.RowCounts);
                    }
                }
            }

            fs.Dispose();
        }