GetWriteConfigurationGetFileRead &

ReExtractComapareUpdatePassDirectory
This commit is contained in:
2022-02-22 09:44:21 -07:00
parent 54161602da
commit de7c2f6f36
12 changed files with 65 additions and 177 deletions

View File

@ -37,13 +37,9 @@ public class CDE3
_CDE3.Staging__v2_36_1__CDE3__RsM();
MethodBase methodBase = new StackFrame().GetMethod();
string[] variables = _CDE3.AdaptationTesting.GetVariables(methodBase, check);
Tuple<string, string[], string[]> pdsf = Helpers.Metrology.GetLogisticsColumnsAndBody(variables[2], variables[4]);
IFileRead fileRead = _CDE3.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResult = fileRead.ReExtract();
Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1));
Assert.IsTrue(extractResult.Item3.Length > 0, "extractResult Array Length check!");
Assert.IsNotNull(extractResult.Item4);
Logistics logistics = new(fileRead);
string extractResultItem1 = Helpers.Metrology.ReExtractComapareUpdatePassDirectory(variables, fileRead, logistics);
dateTime = Adaptation.FileHandlers.RsM.ProcessData.GetDateTime(logistics, string.Empty);
Assert.IsTrue(dateTime == logistics.DateTimeFromSequence);
dateTime = Adaptation.FileHandlers.RsM.ProcessData.GetDateTime(logistics, "00:13 09/27/38");
@ -65,23 +61,13 @@ pt# R Th Rs[Ohm/sq@T] Merit
5 -65.0 -44.5 577.0866 69.79
Avg = 577.2195 0.58% SEMI Radial= 0.81%
";
bool logBodyCheck = logBody.Trim() == extractResult.Item1.Trim();
bool logBodyCheck = logBody.Trim() == extractResultItem1.Trim();
if (!logBodyCheck)
{
_ = Process.Start("explorer.exe", variables[5]);
File.WriteAllText(Path.Combine(variables[5], $"{Path.GetFileName(variables[5])}.log"), extractResult.Item1);
File.WriteAllText(Path.Combine(variables[5], $"{Path.GetFileName(variables[5])}.log"), extractResultItem1);
}
Assert.IsTrue(logBodyCheck, "Log Body doesn't match!");
Tuple<string, string[], string[]> pdsfNew = Helpers.Metrology.GetLogisticsColumnsAndBody(fileRead, logistics, extractResult, pdsf);
Helpers.Metrology.CompareSave(variables[5], pdsf, pdsfNew);
Assert.IsTrue(pdsf.Item1 == pdsfNew.Item1, "Item1 check!");
string[] json = Helpers.Metrology.GetItem2(pdsf, pdsfNew);
Helpers.Metrology.CompareSaveJSON(variables[5], json);
Assert.IsTrue(json[0] == json[1], "Item2 check!");
string[] join = Helpers.Metrology.GetItem3(pdsf, pdsfNew);
Helpers.Metrology.CompareSaveTSV(variables[5], join);
Assert.IsTrue(join[0] == join[1], "Item3 (Join) check!");
Helpers.Metrology.UpdatePassDirectory(variables[2]);
}
}

View File

@ -36,23 +36,9 @@ public class MET08RESIMAPCDE
MethodBase methodBase = new StackFrame().GetMethod();
_MET08RESIMAPCDE.Staging__v2_36_1__MET08RESIMAPCDE__MET08RESIMAPCDE();
string[] variables = _MET08RESIMAPCDE.AdaptationTesting.GetVariables(methodBase, check);
Tuple<string, string[], string[]> pdsf = Helpers.Metrology.GetLogisticsColumnsAndBody(variables[2], variables[4]);
IFileRead fileRead = _MET08RESIMAPCDE.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResult = fileRead.ReExtract();
Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1));
Assert.IsTrue(extractResult.Item3.Length > 0, "extractResult Array Length check!");
Assert.IsNotNull(extractResult.Item4);
Logistics logistics = new(fileRead);
Tuple<string, string[], string[]> pdsfNew = Helpers.Metrology.GetLogisticsColumnsAndBody(fileRead, logistics, extractResult, pdsf);
Helpers.Metrology.CompareSave(variables[5], pdsf, pdsfNew);
Assert.IsTrue(pdsf.Item1 == pdsfNew.Item1, "Item1 check!");
string[] json = Helpers.Metrology.GetItem2(pdsf, pdsfNew);
Helpers.Metrology.CompareSaveJSON(variables[5], json);
Assert.IsTrue(json[0] == json[1], "Item2 check!");
string[] join = Helpers.Metrology.GetItem3(pdsf, pdsfNew);
Helpers.Metrology.CompareSaveTSV(variables[5], join);
Assert.IsTrue(join[0] == join[1], "Item3 (Join) check!");
Helpers.Metrology.UpdatePassDirectory(variables[2]);
_ = Helpers.Metrology.ReExtractComapareUpdatePassDirectory(variables, fileRead, logistics);
}
[TestMethod]

View File

@ -37,13 +37,9 @@ public class CDE3
_CDE3.Staging__v2_39_0__CDE3__RsM();
MethodBase methodBase = new StackFrame().GetMethod();
string[] variables = _CDE3.AdaptationTesting.GetVariables(methodBase, check);
Tuple<string, string[], string[]> pdsf = Helpers.Metrology.GetLogisticsColumnsAndBody(variables[2], variables[4]);
IFileRead fileRead = _CDE3.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResult = fileRead.ReExtract();
Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1));
Assert.IsTrue(extractResult.Item3.Length > 0, "extractResult Array Length check!");
Assert.IsNotNull(extractResult.Item4);
Logistics logistics = new(fileRead);
string extractResultItem1 = Helpers.Metrology.ReExtractComapareUpdatePassDirectory(variables, fileRead, logistics);
dateTime = Adaptation.FileHandlers.RsM.ProcessData.GetDateTime(logistics, string.Empty);
Assert.IsTrue(dateTime == logistics.DateTimeFromSequence);
dateTime = Adaptation.FileHandlers.RsM.ProcessData.GetDateTime(logistics, "00:13 09/27/38");
@ -65,23 +61,13 @@ pt# R Th Rs[Ohm/sq@T] Merit
5 -65.0 -44.5 577.0866 69.79
Avg = 577.2195 0.58% SEMI Radial= 0.81%
";
bool logBodyCheck = logBody.Trim() == extractResult.Item1.Trim();
bool logBodyCheck = logBody.Trim() == extractResultItem1.Trim();
if (!logBodyCheck)
{
_ = Process.Start("explorer.exe", variables[5]);
File.WriteAllText(Path.Combine(variables[5], $"{Path.GetFileName(variables[5])}.log"), extractResult.Item1);
File.WriteAllText(Path.Combine(variables[5], $"{Path.GetFileName(variables[5])}.log"), extractResultItem1);
}
Assert.IsTrue(logBodyCheck, "Log Body doesn't match!");
Tuple<string, string[], string[]> pdsfNew = Helpers.Metrology.GetLogisticsColumnsAndBody(fileRead, logistics, extractResult, pdsf);
Helpers.Metrology.CompareSave(variables[5], pdsf, pdsfNew);
Assert.IsTrue(pdsf.Item1 == pdsfNew.Item1, "Item1 check!");
string[] json = Helpers.Metrology.GetItem2(pdsf, pdsfNew);
Helpers.Metrology.CompareSaveJSON(variables[5], json);
Assert.IsTrue(json[0] == json[1], "Item2 check!");
string[] join = Helpers.Metrology.GetItem3(pdsf, pdsfNew);
Helpers.Metrology.CompareSaveTSV(variables[5], join);
Assert.IsTrue(join[0] == join[1], "Item3 (Join) check!");
Helpers.Metrology.UpdatePassDirectory(variables[2]);
}
}

View File

@ -36,23 +36,9 @@ public class MET08RESIMAPCDE
MethodBase methodBase = new StackFrame().GetMethod();
_MET08RESIMAPCDE.Staging__v2_39_0__MET08RESIMAPCDE__MET08RESIMAPCDE();
string[] variables = _MET08RESIMAPCDE.AdaptationTesting.GetVariables(methodBase, check);
Tuple<string, string[], string[]> pdsf = Helpers.Metrology.GetLogisticsColumnsAndBody(variables[2], variables[4]);
IFileRead fileRead = _MET08RESIMAPCDE.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResult = fileRead.ReExtract();
Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1));
Assert.IsTrue(extractResult.Item3.Length > 0, "extractResult Array Length check!");
Assert.IsNotNull(extractResult.Item4);
Logistics logistics = new(fileRead);
Tuple<string, string[], string[]> pdsfNew = Helpers.Metrology.GetLogisticsColumnsAndBody(fileRead, logistics, extractResult, pdsf);
Helpers.Metrology.CompareSave(variables[5], pdsf, pdsfNew);
Assert.IsTrue(pdsf.Item1 == pdsfNew.Item1, "Item1 check!");
string[] json = Helpers.Metrology.GetItem2(pdsf, pdsfNew);
Helpers.Metrology.CompareSaveJSON(variables[5], json);
Assert.IsTrue(json[0] == json[1], "Item2 check!");
string[] join = Helpers.Metrology.GetItem3(pdsf, pdsfNew);
Helpers.Metrology.CompareSaveTSV(variables[5], join);
Assert.IsTrue(join[0] == join[1], "Item3 (Join) check!");
Helpers.Metrology.UpdatePassDirectory(variables[2]);
_ = Helpers.Metrology.ReExtractComapareUpdatePassDirectory(variables, fileRead, logistics);
}
[TestMethod]