[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)
here is powershell script on how to get list of files from changesets associated with one tfs task
$dllPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\...
-
2010-11-24 Update: Please download latest version of Pidgin , that has this problem fixed , no additional steps required. Here are 3 ways to...
-
$z = Import-Csv zerotrac.csv $nums = Import-Csv allleetcode.csv $md =@{} #converting one csv into hashmap for quicker search foreac...
-
Error:The element 'Schedule' has invalid child element 'RecurrenceRule'. List of possible elements expected: 'Occurring...
No comments:
Post a Comment