diff --git a/Adaptation/FileHandlers/MET08THFTIRSTRATUS/FileRead.cs b/Adaptation/FileHandlers/MET08THFTIRSTRATUS/FileRead.cs index 667fc72..68ba7ee 100644 --- a/Adaptation/FileHandlers/MET08THFTIRSTRATUS/FileRead.cs +++ b/Adaptation/FileHandlers/MET08THFTIRSTRATUS/FileRead.cs @@ -257,7 +257,6 @@ public class FileRead : Shared.FileRead, IFileRead scopeInfo = new ScopeInfo(test, _IqsFile); else scopeInfo = new ScopeInfo(test, _OpenInsightFilePattern); - //lines = ProcessDataStandardFormat.GetLines(this, scopeInfo, names, values, dateFormat: "M/d/yyyy hh:mm:ss tt", timeFormat: string.Empty, pairedColumns: ExtractResultPairedColumns); lines = ProcessData.GetLines(this, _Logistics, descriptions); tuples.Add(new Tuple(scopeInfo, lines)); } @@ -350,7 +349,7 @@ public class FileRead : Shared.FileRead, IFileRead continue; ZipFile.ExtractToDirectory(sourceArchiveFile, inProcessDirectory); if (fileConnectorConfigurationIncludeSubDirectories && includeSubDirectoriesExtra) - checkDirectory = string.Concat(checkDirectory, @"\", sequence); + checkDirectory = string.Concat(checkDirectory, @"\", sequence); if (fileConnectorConfigurationIncludeSubDirectories) files = Directory.GetFiles(inProcessDirectory, "*", SearchOption.AllDirectories); else diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.36.3/BIORAD4.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.36.3/BIORAD4.cs index a723efc..e612f2e 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.36.3/BIORAD4.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.36.3/BIORAD4.cs @@ -54,11 +54,7 @@ public class BIORAD4 : EAFLoggingUnitTesting string check = "*DataBioRad.txt"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } @@ -68,11 +64,7 @@ public class BIORAD4 : EAFLoggingUnitTesting string check = "CassetteDataBioRad_*.txt"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.36.3/BIORAD5.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.36.3/BIORAD5.cs index 94fe441..a954e95 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.36.3/BIORAD5.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.36.3/BIORAD5.cs @@ -54,11 +54,7 @@ public class BIORAD5 : EAFLoggingUnitTesting string check = "*DataBioRad.txt"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } @@ -68,11 +64,7 @@ public class BIORAD5 : EAFLoggingUnitTesting string check = "CassetteDataBioRad_*.txt"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.36.3/MET08THFTIRSTRATUS.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.36.3/MET08THFTIRSTRATUS.cs index 7817bff..8c15371 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.36.3/MET08THFTIRSTRATUS.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.36.3/MET08THFTIRSTRATUS.cs @@ -54,11 +54,7 @@ public class MET08THFTIRSTRATUS : EAFLoggingUnitTesting string check = "~IsXToOpenInsightMetrologyViewer"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } @@ -68,11 +64,7 @@ public class MET08THFTIRSTRATUS : EAFLoggingUnitTesting string check = "~IsXToIQSSi"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } @@ -82,11 +74,7 @@ public class MET08THFTIRSTRATUS : EAFLoggingUnitTesting string check = "~IsXToOpenInsight"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } @@ -96,11 +84,7 @@ public class MET08THFTIRSTRATUS : EAFLoggingUnitTesting string check = "~IsXToOpenInsightMetrologyViewerAttachments"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } @@ -110,11 +94,7 @@ public class MET08THFTIRSTRATUS : EAFLoggingUnitTesting string check = "~IsXToAPC"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } @@ -124,11 +104,7 @@ public class MET08THFTIRSTRATUS : EAFLoggingUnitTesting string check = "~IsXToSPaCe"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } @@ -138,11 +114,7 @@ public class MET08THFTIRSTRATUS : EAFLoggingUnitTesting string check = "~IsXToArchive"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } @@ -152,11 +124,7 @@ public class MET08THFTIRSTRATUS : EAFLoggingUnitTesting string check = "~IsArchive"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } @@ -166,11 +134,7 @@ public class MET08THFTIRSTRATUS : EAFLoggingUnitTesting string check = "~IsDummy"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/BIORAD4.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/BIORAD4.cs index 3df1526..5714e05 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/BIORAD4.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/BIORAD4.cs @@ -54,11 +54,7 @@ public class BIORAD4 : EAFLoggingUnitTesting string check = "*DataBioRad.txt"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } @@ -68,11 +64,7 @@ public class BIORAD4 : EAFLoggingUnitTesting string check = "CassetteDataBioRad_*.txt"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/BIORAD5.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/BIORAD5.cs index 24d380e..ab06ed1 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/BIORAD5.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/BIORAD5.cs @@ -54,11 +54,7 @@ public class BIORAD5 : EAFLoggingUnitTesting string check = "*DataBioRad.txt"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } @@ -68,11 +64,7 @@ public class BIORAD5 : EAFLoggingUnitTesting string check = "CassetteDataBioRad_*.txt"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/MET08THFTIRSTRATUS.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/MET08THFTIRSTRATUS.cs index 8e2cfdd..beb70dd 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/MET08THFTIRSTRATUS.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/MET08THFTIRSTRATUS.cs @@ -54,11 +54,7 @@ public class MET08THFTIRSTRATUS : EAFLoggingUnitTesting string check = "~IsXToOpenInsightMetrologyViewer"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } @@ -68,11 +64,7 @@ public class MET08THFTIRSTRATUS : EAFLoggingUnitTesting string check = "~IsXToIQSSi"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } @@ -82,11 +74,7 @@ public class MET08THFTIRSTRATUS : EAFLoggingUnitTesting string check = "~IsXToOpenInsight"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } @@ -96,11 +84,7 @@ public class MET08THFTIRSTRATUS : EAFLoggingUnitTesting string check = "~IsXToOpenInsightMetrologyViewerAttachments"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } @@ -110,11 +94,7 @@ public class MET08THFTIRSTRATUS : EAFLoggingUnitTesting string check = "~IsXToAPC"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } @@ -124,11 +104,7 @@ public class MET08THFTIRSTRATUS : EAFLoggingUnitTesting string check = "~IsXToSPaCe"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } @@ -138,11 +114,7 @@ public class MET08THFTIRSTRATUS : EAFLoggingUnitTesting string check = "~IsXToArchive"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } @@ -152,11 +124,7 @@ public class MET08THFTIRSTRATUS : EAFLoggingUnitTesting string check = "~IsArchive"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } @@ -166,11 +134,7 @@ public class MET08THFTIRSTRATUS : EAFLoggingUnitTesting string check = "~IsDummy"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase); - Assert.IsTrue(fileNameAndJson[1].Contains(check)); - File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); - IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); - Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName)); + _ = Helpers.Metrology.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } diff --git a/Adaptation/_Tests/Extract/Staging/v2.36.3/BIORAD4.cs b/Adaptation/_Tests/Extract/Staging/v2.36.3/BIORAD4.cs index f0178e0..e569d6a 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.36.3/BIORAD4.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.36.3/BIORAD4.cs @@ -69,23 +69,9 @@ public class BIORAD4 _BIORAD4.Staging__v2_36_3__BIORAD4__Stratus(); MethodBase methodBase = new StackFrame().GetMethod(); string[] variables = _BIORAD4.AdaptationTesting.GetVariables(methodBase, check); - Tuple pdsf = Helpers.Metrology.GetLogisticsColumnsAndBody(variables[2], variables[4]); IFileRead fileRead = _BIORAD4.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); - Tuple> 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 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] @@ -95,23 +81,9 @@ public class BIORAD4 _BIORAD4.Staging__v2_36_3__BIORAD4__Stratus(); MethodBase methodBase = new StackFrame().GetMethod(); string[] variables = _BIORAD4.AdaptationTesting.GetVariables(methodBase, check); - Tuple pdsf = Helpers.Metrology.GetLogisticsColumnsAndBody(variables[2], variables[4]); IFileRead fileRead = _BIORAD4.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); - Tuple> 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 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] @@ -122,27 +94,13 @@ public class BIORAD4 _BIORAD4.Staging__v2_36_3__BIORAD4__Stratus(); MethodBase methodBase = new StackFrame().GetMethod(); string[] variables = _BIORAD4.AdaptationTesting.GetVariables(methodBase, check); - Tuple pdsf = Helpers.Metrology.GetLogisticsColumnsAndBody(variables[2], variables[4]); IFileRead fileRead = _BIORAD4.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); - Tuple> 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); + _ = Helpers.Metrology.ReExtractComapareUpdatePassDirectory(variables, fileRead, logistics); dateTime = Adaptation.FileHandlers.Stratus.ProcessData.GetDateTime(logistics, string.Empty); Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); dateTime = Adaptation.FileHandlers.Stratus.ProcessData.GetDateTime(logistics, "11/24/21 08:39"); Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); - Tuple 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]); } [TestMethod] diff --git a/Adaptation/_Tests/Extract/Staging/v2.36.3/BIORAD5.cs b/Adaptation/_Tests/Extract/Staging/v2.36.3/BIORAD5.cs index 19f87a4..6059731 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.36.3/BIORAD5.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.36.3/BIORAD5.cs @@ -40,27 +40,13 @@ public class BIORAD5 _BIORAD5.Staging__v2_36_3__BIORAD5__Stratus(); MethodBase methodBase = new StackFrame().GetMethod(); string[] variables = _BIORAD5.AdaptationTesting.GetVariables(methodBase, check); - Tuple pdsf = Helpers.Metrology.GetLogisticsColumnsAndBody(variables[2], variables[4]); IFileRead fileRead = _BIORAD5.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); - Tuple> 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); + _ = Helpers.Metrology.ReExtractComapareUpdatePassDirectory(variables, fileRead, logistics); dateTime = Adaptation.FileHandlers.Stratus.ProcessData.GetDateTime(logistics, string.Empty); Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); dateTime = Adaptation.FileHandlers.Stratus.ProcessData.GetDateTime(logistics, "11/24/21 08:39"); Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); - Tuple 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]); } [TestMethod] diff --git a/Adaptation/_Tests/Extract/Staging/v2.39.0/BIORAD4.cs b/Adaptation/_Tests/Extract/Staging/v2.39.0/BIORAD4.cs index 3c9cbbd..18a3371 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.39.0/BIORAD4.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.39.0/BIORAD4.cs @@ -69,23 +69,9 @@ public class BIORAD4 _BIORAD4.Staging__v2_39_0__BIORAD4__Stratus(); MethodBase methodBase = new StackFrame().GetMethod(); string[] variables = _BIORAD4.AdaptationTesting.GetVariables(methodBase, check); - Tuple pdsf = Helpers.Metrology.GetLogisticsColumnsAndBody(variables[2], variables[4]); IFileRead fileRead = _BIORAD4.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); - Tuple> 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 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] @@ -95,23 +81,9 @@ public class BIORAD4 _BIORAD4.Staging__v2_39_0__BIORAD4__Stratus(); MethodBase methodBase = new StackFrame().GetMethod(); string[] variables = _BIORAD4.AdaptationTesting.GetVariables(methodBase, check); - Tuple pdsf = Helpers.Metrology.GetLogisticsColumnsAndBody(variables[2], variables[4]); IFileRead fileRead = _BIORAD4.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); - Tuple> 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 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] @@ -122,27 +94,13 @@ public class BIORAD4 _BIORAD4.Staging__v2_39_0__BIORAD4__Stratus(); MethodBase methodBase = new StackFrame().GetMethod(); string[] variables = _BIORAD4.AdaptationTesting.GetVariables(methodBase, check); - Tuple pdsf = Helpers.Metrology.GetLogisticsColumnsAndBody(variables[2], variables[4]); IFileRead fileRead = _BIORAD4.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); - Tuple> 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); + _ = Helpers.Metrology.ReExtractComapareUpdatePassDirectory(variables, fileRead, logistics); dateTime = Adaptation.FileHandlers.Stratus.ProcessData.GetDateTime(logistics, string.Empty); Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); dateTime = Adaptation.FileHandlers.Stratus.ProcessData.GetDateTime(logistics, "11/24/21 08:39"); Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); - Tuple 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]); } [TestMethod] diff --git a/Adaptation/_Tests/Extract/Staging/v2.39.0/BIORAD5.cs b/Adaptation/_Tests/Extract/Staging/v2.39.0/BIORAD5.cs index 28aa994..ff6be59 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.39.0/BIORAD5.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.39.0/BIORAD5.cs @@ -37,27 +37,13 @@ public class BIORAD5 _BIORAD5.Staging__v2_39_0__BIORAD5__txt(); MethodBase methodBase = new StackFrame().GetMethod(); string[] variables = _BIORAD5.AdaptationTesting.GetVariables(methodBase, check); - Tuple pdsf = Helpers.Metrology.GetLogisticsColumnsAndBody(variables[2], variables[4]); IFileRead fileRead = _BIORAD5.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); - Tuple> 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); + _ = Helpers.Metrology.ReExtractComapareUpdatePassDirectory(variables, fileRead, logistics); dateTime = Adaptation.FileHandlers.Stratus.ProcessData.GetDateTime(logistics, string.Empty); Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); dateTime = Adaptation.FileHandlers.Stratus.ProcessData.GetDateTime(logistics, "11/24/21 08:39"); Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); - Tuple 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]); } [TestMethod] @@ -71,27 +57,13 @@ public class BIORAD5 _BIORAD5.Staging__v2_39_0__BIORAD5__Stratus(); MethodBase methodBase = new StackFrame().GetMethod(); string[] variables = _BIORAD5.AdaptationTesting.GetVariables(methodBase, check); - Tuple pdsf = Helpers.Metrology.GetLogisticsColumnsAndBody(variables[2], variables[4]); IFileRead fileRead = _BIORAD5.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); - Tuple> 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); + _ = Helpers.Metrology.ReExtractComapareUpdatePassDirectory(variables, fileRead, logistics); dateTime = Adaptation.FileHandlers.Stratus.ProcessData.GetDateTime(logistics, string.Empty); Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); dateTime = Adaptation.FileHandlers.Stratus.ProcessData.GetDateTime(logistics, "11/24/21 08:39"); Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); - Tuple 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]); } [TestMethod] @@ -102,27 +74,13 @@ public class BIORAD5 _BIORAD5.Staging__v2_39_0__BIORAD5__Stratus(); MethodBase methodBase = new StackFrame().GetMethod(); string[] variables = _BIORAD5.AdaptationTesting.GetVariables(methodBase, check); - Tuple pdsf = Helpers.Metrology.GetLogisticsColumnsAndBody(variables[2], variables[4]); IFileRead fileRead = _BIORAD5.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); - Tuple> 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); + _ = Helpers.Metrology.ReExtractComapareUpdatePassDirectory(variables, fileRead, logistics); dateTime = Adaptation.FileHandlers.Stratus.ProcessData.GetDateTime(logistics, string.Empty); Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); dateTime = Adaptation.FileHandlers.Stratus.ProcessData.GetDateTime(logistics, "11/24/21 08:39"); Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); - Tuple 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]); } [TestMethod] diff --git a/Adaptation/_Tests/Helpers/Metrology.cs b/Adaptation/_Tests/Helpers/Metrology.cs index 0d41570..d397324 100644 --- a/Adaptation/_Tests/Helpers/Metrology.cs +++ b/Adaptation/_Tests/Helpers/Metrology.cs @@ -153,4 +153,37 @@ public class Metrology } } + internal static IFileRead GetWriteConfigurationGetFileRead(MethodBase methodBase, string check, Shared.AdaptationTesting adaptationTesting) + { + IFileRead result; + string[] fileNameAndJson = adaptationTesting.GetConfiguration(methodBase); + Assert.IsTrue(fileNameAndJson[1].Contains(check)); + File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]); + result = adaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false); + Assert.IsFalse(string.IsNullOrEmpty(result.CellInstanceConnectionName)); + return result; + } + + internal static string ReExtractComapareUpdatePassDirectory(string[] variables, IFileRead fileRead, Logistics logistics) + { + string result; + Tuple> extractResult = fileRead.ReExtract(); + Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1)); + Assert.IsTrue(extractResult.Item3.Length > 0, "extractResult Array Length check!"); + Assert.IsNotNull(extractResult.Item4); + Tuple pdsf = GetLogisticsColumnsAndBody(variables[2], variables[4]); + Tuple pdsfNew = GetLogisticsColumnsAndBody(fileRead, logistics, extractResult, pdsf); + CompareSave(variables[5], pdsf, pdsfNew); + Assert.IsTrue(pdsf.Item1 == pdsfNew.Item1, "Item1 check!"); + string[] json = GetItem2(pdsf, pdsfNew); + CompareSaveJSON(variables[5], json); + Assert.IsTrue(json[0] == json[1], "Item2 check!"); + string[] join = GetItem3(pdsf, pdsfNew); + CompareSaveTSV(variables[5], join); + Assert.IsTrue(join[0] == join[1], "Item3 (Join) check!"); + UpdatePassDirectory(variables[2]); + result = extractResult.Item1; + return result; + } + } \ No newline at end of file