[TestMethod] public void TransactionBalance_FilesTest() { const string exp = "System.Data.InvalidExpressionException: "; var test_files = Directory.GetFiles(@"c:\temp\usage", "*.txt"); HashSet<string> h = new HashSet<string>(); var regex1 = new Regex(@"([C|D]{1})([0-9]{2})([0-9]{2})([0-9]{2})([A-Z]{3})(-?\d.*)"); int done1 = 0; int done2 = 0; foreach (var file in test_files) { foreach (var l in File.ReadAllLines(file)) { int pos = l.IndexOf(exp); if (pos > -1) { var data = l.Substring(pos + exp.Length); var match = regex1.Match(data); if (match.Groups.Count < 7) { data = PreprocessData(data); match = regex1.Match(data); if (match.Groups.Count < 7) { if (!h.Contains(data)) { h.Add(data + " =>ORIG=> " + l); } } else { done2 += 1; } } else { done1 += 1; } } } } StringBuilder sb = new StringBuilder("completed "+done1+" second attempt="+done2+"\r\n"); foreach (string item in h) { sb.AppendLine(item); } TestMaker tm = new TestMaker(man); Console.WriteLine(tm.Save("txt", sb.ToString())); }
Tuesday
log file from folder for unit test
Subscribe to:
Post Comments (Atom)
test smtp server with powershell
Send-MailMessage -SMTPServer smtp.domain.com -To [email protected] -From [email protected] -Subject "This is a test email" -Body ...
-
Here is instruction how to make blinking text in rainmeter: 1.right click and select " Edit skin " 2.add following code to temp...
-
Error:The element 'Schedule' has invalid child element 'RecurrenceRule'. List of possible elements expected: 'Occurring...
-
If you use Visual Studio to open a Web project that was developed for the .NET Framework 2.0, the .NET Framework 3.0, or the .NET Framework...
No comments:
Post a Comment