diff --git a/Adaptation/.editorconfig b/Adaptation/.editorconfig index b45701e..3c9827a 100644 --- a/Adaptation/.editorconfig +++ b/Adaptation/.editorconfig @@ -1,3 +1,19 @@ +[*.md] +end_of_line = crlf +file_header_template = unset +indent_size = 2 +indent_style = space +insert_final_newline = false +root = true +tab_width = 2 +[*.csproj] +end_of_line = crlf +file_header_template = unset +indent_size = 2 +indent_style = space +insert_final_newline = false +root = true +tab_width = 2 [*.cs] csharp_indent_block_contents = true csharp_indent_braces = false @@ -82,13 +98,25 @@ dotnet_diagnostic.CA1829.severity = warning # CA1829: Use Length/Count property dotnet_diagnostic.CA1834.severity = warning # CA1834: Consider using 'StringBuilder.Append(char)' when applicable dotnet_diagnostic.CA1846.severity = none # CA1846: Prefer AsSpan over Substring dotnet_diagnostic.CA1847.severity = none # CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters +dotnet_diagnostic.CA1860.severity = error # CA1860: Prefer comparing 'Count' to 0 rather than using 'Any()', both for clarity and for performance +dotnet_diagnostic.CA1864.severity = none # CA1864: To avoid double lookup, call 'TryAdd' instead of calling 'Add' with a 'ContainsKey' guard +dotnet_diagnostic.CA1869.severity = none # CA1869: Avoid creating a new 'JsonSerializerOptions' instance for every serialization operation. Cache and reuse instances instead. +dotnet_diagnostic.CA2254.severity = none # CA2254: The logging message template should not vary between calls to 'LoggerExtensions.LogInformation(ILogger, string?, params object?[])' dotnet_diagnostic.IDE0001.severity = warning # IDE0001: Simplify name dotnet_diagnostic.IDE0002.severity = warning # Simplify (member access) - System.Version.Equals("1", "2"); Version.Equals("1", "2"); dotnet_diagnostic.IDE0004.severity = warning # IDE0004: Cast is redundant. dotnet_diagnostic.IDE0005.severity = warning # Using directive is unnecessary +dotnet_diagnostic.IDE0028.severity = none # IDE0028: Collection initialization can be simplified +dotnet_diagnostic.IDE0031.severity = warning # Use null propagation (IDE0031) dotnet_diagnostic.IDE0047.severity = warning # IDE0047: Parentheses can be removed dotnet_diagnostic.IDE0049.severity = warning # Use language keywords instead of framework type names for type references (IDE0049) dotnet_diagnostic.IDE0060.severity = warning # IDE0060: Remove unused parameter +dotnet_diagnostic.IDE0270.severity = none # IDE0270: Null check can be simplified +dotnet_diagnostic.IDE0290.severity = none # Use primary constructor [Distance]csharp(IDE0290) +dotnet_diagnostic.IDE0300.severity = none # IDE0300: Collection initialization can be simplified +dotnet_diagnostic.IDE0301.severity = none #IDE0301: Collection initialization can be simplified +dotnet_diagnostic.IDE0305.severity = none # IDE0305: Collection initialization can be simplified +dotnet_diagnostic.SYSLIB1045.severity = none # SYSLIB1045: dotnet_naming_rule.abstract_method_should_be_pascal_case.severity = warning dotnet_naming_rule.abstract_method_should_be_pascal_case.style = pascal_case dotnet_naming_rule.abstract_method_should_be_pascal_case.symbols = abstract_method diff --git a/Adaptation/FileHandlers/Archive/FileRead.cs b/Adaptation/FileHandlers/Archive/FileRead.cs index 3cc4d71..0e79541 100644 --- a/Adaptation/FileHandlers/Archive/FileRead.cs +++ b/Adaptation/FileHandlers/Archive/FileRead.cs @@ -128,7 +128,7 @@ public class FileRead : Shared.FileRead, IFileRead string jobIdDirectory = Path.Combine(_JobIdParentDirectory, _Logistics.JobID); if (!Directory.Exists(jobIdDirectory)) _ = Directory.CreateDirectory(jobIdDirectory); - if (!Directory.GetDirectories(jobIdDirectory).Any()) + if (Directory.GetDirectories(jobIdDirectory).Length == 0) File.Copy(reportFullPath, Path.Combine(destinationArchiveDirectory, Path.GetFileName(reportFullPath))); else { diff --git a/Adaptation/FileHandlers/Dummy/FileRead.cs b/Adaptation/FileHandlers/Dummy/FileRead.cs index 79eda27..916f5d7 100644 --- a/Adaptation/FileHandlers/Dummy/FileRead.cs +++ b/Adaptation/FileHandlers/Dummy/FileRead.cs @@ -157,7 +157,7 @@ public class FileRead : Shared.FileRead, IFileRead if (!Directory.Exists(inProcessDirectory)) _ = Directory.CreateDirectory(inProcessDirectory); files = Directory.GetFiles(inProcessDirectory, "*", SearchOption.AllDirectories); - if (files.Any()) + if (files.Length != 0) { if (files.Length > 250) throw new Exception("Safety net!"); diff --git a/Adaptation/FileHandlers/MoveMatchingFiles/FileRead.cs b/Adaptation/FileHandlers/MoveMatchingFiles/FileRead.cs index 39f8d62..2d8a495 100644 --- a/Adaptation/FileHandlers/MoveMatchingFiles/FileRead.cs +++ b/Adaptation/FileHandlers/MoveMatchingFiles/FileRead.cs @@ -6,7 +6,6 @@ using Adaptation.Shared.Methods; using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; using System.Text.Json; using System.Threading; @@ -129,7 +128,7 @@ public class FileRead : Shared.FileRead, IFileRead for (int i = 0; i < int.MaxValue; i++) { found = Directory.GetFiles(searchDirectory, fileName, SearchOption.AllDirectories); - if (found.Any()) + if (found.Length != 0) { results.AddRange(found); break; @@ -205,7 +204,7 @@ public class FileRead : Shared.FileRead, IFileRead Thread.Sleep(500); } } - if (postCollection.Any()) + if (postCollection.Count != 0) { Thread.Sleep(500); StringBuilder stringBuilder = new(); diff --git a/Adaptation/FileHandlers/OpenInsight/FileRead.cs b/Adaptation/FileHandlers/OpenInsight/FileRead.cs index 20574a9..2df050c 100644 --- a/Adaptation/FileHandlers/OpenInsight/FileRead.cs +++ b/Adaptation/FileHandlers/OpenInsight/FileRead.cs @@ -156,7 +156,7 @@ public class FileRead : Shared.FileRead, IFileRead _ = Directory.CreateDirectory(duplicateDirectory); } string duplicateFile = Path.Combine(duplicateDirectory, Path.GetFileName(reportFullPath)); - if (descriptions.Any() && tests.Any()) + if (descriptions.Count != 0 && tests.Length != 0) { string lines = GetLines(descriptions); if (!string.IsNullOrEmpty(lines)) diff --git a/Adaptation/FileHandlers/OpenInsight/FromIQS.cs b/Adaptation/FileHandlers/OpenInsight/FromIQS.cs index bee2835..2d5e211 100644 --- a/Adaptation/FileHandlers/OpenInsight/FromIQS.cs +++ b/Adaptation/FileHandlers/OpenInsight/FromIQS.cs @@ -135,17 +135,17 @@ public class FromIQS else { JsonElement[]? jsonElements = JsonSerializer.Deserialize(stringBuilder.ToString()); - if (jsonElements is null || !jsonElements.Any() || jsonElements[0].ValueKind != JsonValueKind.Object) + if (jsonElements is null || jsonElements.Length == 0 || jsonElements[0].ValueKind != JsonValueKind.Object) commandText = stringBuilder.ToString(); else { JsonProperty[] jsonProperties = jsonElements[0].EnumerateObject().ToArray(); - if (!jsonProperties.Any() || jsonProperties[3].Name != "se_sgrp" || !long.TryParse(jsonProperties[3].Value.ToString(), out long subGroupId)) + if (jsonProperties.Length == 0 || jsonProperties[3].Name != "se_sgrp" || !long.TryParse(jsonProperties[3].Value.ToString(), out long subGroupId)) commandText = stringBuilder.ToString(); else { result = subGroupId; - if (jsonProperties.Any() && jsonProperties[0].Name == "ev_count" && int.TryParse(jsonProperties[0].Value.ToString(), out int evCount)) + if (jsonProperties.Length != 0 && jsonProperties[0].Name == "ev_count" && int.TryParse(jsonProperties[0].Value.ToString(), out int evCount)) count = evCount; } } diff --git a/Adaptation/FileHandlers/OpenInsightMetrologyViewer/WSRequest.cs b/Adaptation/FileHandlers/OpenInsightMetrologyViewer/WSRequest.cs index 1d1d361..e06021f 100644 --- a/Adaptation/FileHandlers/OpenInsightMetrologyViewer/WSRequest.cs +++ b/Adaptation/FileHandlers/OpenInsightMetrologyViewer/WSRequest.cs @@ -2,7 +2,6 @@ using Adaptation.Shared.Properties; using System; using System.Collections.Generic; -using System.Linq; namespace Adaptation.FileHandlers.OpenInsightMetrologyViewer; @@ -80,7 +79,7 @@ public class WSRequest Details.Add(detail); } Date ??= logistics.DateTimeFromSequence.ToString(); - if (UniqueId is null && Details.Any()) + if (UniqueId is null && Details.Count != 0) UniqueId = Details[0].HeaderUniqueId; } diff --git a/Adaptation/FileHandlers/QS408M/Description.cs b/Adaptation/FileHandlers/QS408M/Description.cs index 02464ba..8837a9f 100644 --- a/Adaptation/FileHandlers/QS408M/Description.cs +++ b/Adaptation/FileHandlers/QS408M/Description.cs @@ -55,7 +55,21 @@ public class Description : IDescription, Shared.Properties.IDescription public string ThicknessFourteenCriticalPointsAverage { get; set; } public string ThicknessFourteenCriticalPointsStdDev { get; set; } public string ThicknessFourteenMeanFrom { get; set; } - public string ThicknessFourteenPoints { get; set; } + // + public string Thickness01 { get; set; } + public string Thickness02 { get; set; } + public string Thickness03 { get; set; } + public string Thickness04 { get; set; } + public string Thickness05 { get; set; } + public string Thickness06 { get; set; } + public string Thickness07 { get; set; } + public string Thickness08 { get; set; } + public string Thickness09 { get; set; } + public string Thickness10 { get; set; } + public string Thickness11 { get; set; } + public string Thickness12 { get; set; } + public string Thickness13 { get; set; } + public string Thickness14 { get; set; } string IDescription.GetEventDescription() => "File Has been read and parsed"; @@ -127,7 +141,6 @@ public class Description : IDescription, Shared.Properties.IDescription nameof(ThicknessFourteenCriticalPointsAverage), nameof(ThicknessFourteenCriticalPointsStdDev), nameof(ThicknessFourteenMeanFrom), - nameof(ThicknessFourteenPoints), }; return results; } @@ -179,7 +192,7 @@ public class Description : IDescription, Shared.Properties.IDescription List IDescription.GetDescriptions(IFileRead fileRead, Logistics logistics, List tests, IProcessData iProcessData) { List results = new(); - if (iProcessData is null || !iProcessData.Details.Any() || iProcessData is not ProcessData processData) + if (iProcessData is null || iProcessData.Details.Count == 0 || iProcessData is not ProcessData processData) results.Add(GetDefault(fileRead, logistics)); else { @@ -241,7 +254,20 @@ public class Description : IDescription, Shared.Properties.IDescription ThicknessFourteenCriticalPointsAverage = processData.ThicknessFourteenCriticalPointsAverage, ThicknessFourteenCriticalPointsStdDev = processData.ThicknessFourteenCriticalPointsStdDev, ThicknessFourteenMeanFrom = processData.ThicknessFourteenMeanFrom, - ThicknessFourteenPoints = processData.ThicknessFourteenPoints, + Thickness01 = iProcessData.Details.Count < 1 || iProcessData.Details[0] is not Detail thickness01 ? string.Empty : thickness01.Thickness, + Thickness02 = iProcessData.Details.Count < 2 || iProcessData.Details[1] is not Detail thickness02 ? string.Empty : thickness02.Thickness, + Thickness03 = iProcessData.Details.Count < 3 || iProcessData.Details[2] is not Detail thickness03 ? string.Empty : thickness03.Thickness, + Thickness04 = iProcessData.Details.Count < 4 || iProcessData.Details[3] is not Detail thickness04 ? string.Empty : thickness04.Thickness, + Thickness05 = iProcessData.Details.Count < 5 || iProcessData.Details[4] is not Detail thickness05 ? string.Empty : thickness05.Thickness, + Thickness06 = iProcessData.Details.Count < 6 || iProcessData.Details[5] is not Detail thickness06 ? string.Empty : thickness06.Thickness, + Thickness07 = iProcessData.Details.Count < 7 || iProcessData.Details[6] is not Detail thickness07 ? string.Empty : thickness07.Thickness, + Thickness08 = iProcessData.Details.Count < 8 || iProcessData.Details[7] is not Detail thickness08 ? string.Empty : thickness08.Thickness, + Thickness09 = iProcessData.Details.Count < 9 || iProcessData.Details[8] is not Detail thickness09 ? string.Empty : thickness09.Thickness, + Thickness10 = iProcessData.Details.Count < 10 || iProcessData.Details[9] is not Detail thickness10 ? string.Empty : thickness10.Thickness, + Thickness11 = iProcessData.Details.Count < 11 || iProcessData.Details[10] is not Detail thickness11 ? string.Empty : thickness11.Thickness, + Thickness12 = iProcessData.Details.Count < 12 || iProcessData.Details[11] is not Detail thickness12 ? string.Empty : thickness12.Thickness, + Thickness13 = iProcessData.Details.Count < 13 || iProcessData.Details[12] is not Detail thickness13 ? string.Empty : thickness13.Thickness, + Thickness14 = iProcessData.Details.Count < 14 || iProcessData.Details[13] is not Detail thickness14 ? string.Empty : thickness14.Thickness, }; results.Add(description); } @@ -304,7 +330,21 @@ public class Description : IDescription, Shared.Properties.IDescription ThicknessFourteenCriticalPointsAverage = nameof(ThicknessFourteenCriticalPointsAverage), ThicknessFourteenCriticalPointsStdDev = nameof(ThicknessFourteenCriticalPointsStdDev), ThicknessFourteenMeanFrom = nameof(ThicknessFourteenMeanFrom), - ThicknessFourteenPoints = nameof(ThicknessFourteenPoints), + // + Thickness01 = nameof(Thickness01), + Thickness02 = nameof(Thickness02), + Thickness03 = nameof(Thickness03), + Thickness04 = nameof(Thickness04), + Thickness05 = nameof(Thickness05), + Thickness06 = nameof(Thickness06), + Thickness07 = nameof(Thickness07), + Thickness08 = nameof(Thickness08), + Thickness09 = nameof(Thickness09), + Thickness10 = nameof(Thickness10), + Thickness11 = nameof(Thickness11), + Thickness12 = nameof(Thickness12), + Thickness13 = nameof(Thickness13), + Thickness14 = nameof(Thickness14), }; return result; } diff --git a/Adaptation/FileHandlers/QS408M/FileRead.cs b/Adaptation/FileHandlers/QS408M/FileRead.cs index d26af3c..24b1257 100644 --- a/Adaptation/FileHandlers/QS408M/FileRead.cs +++ b/Adaptation/FileHandlers/QS408M/FileRead.cs @@ -5,7 +5,6 @@ using Adaptation.Shared.Methods; using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text.Json; using System.Text.RegularExpressions; @@ -124,7 +123,7 @@ public class FileRead : Shared.FileRead, IFileRead } SetFileParameterLotID(mid); _Logistics.Update(mid, processData.Reactor); - if (!iProcessData.Details.Any()) + if (iProcessData.Details.Count == 0) throw new Exception(string.Concat("B) No Data - ", dateTime.Ticks)); results = iProcessData.GetResults(this, _Logistics, results.Item4); } diff --git a/Adaptation/FileHandlers/QS408M/ProcessData.cs b/Adaptation/FileHandlers/QS408M/ProcessData.cs index a0e7c30..e3ab56e 100644 --- a/Adaptation/FileHandlers/QS408M/ProcessData.cs +++ b/Adaptation/FileHandlers/QS408M/ProcessData.cs @@ -48,7 +48,6 @@ public partial class ProcessData : IProcessData public string ThicknessFourteenCriticalPointsAverage { get; set; } public string ThicknessFourteenCriticalPointsStdDev { get; set; } public string ThicknessFourteenMeanFrom { get; set; } - public string ThicknessFourteenPoints { get; set; } List Shared.Properties.IProcessData.Details => _Details; @@ -360,7 +359,6 @@ public partial class ProcessData : IProcessData } if (thicknessPoints.Count != 14) { - ThicknessFourteenPoints = string.Empty; ThicknessFourteenMeanFrom = string.Empty; ThicknessFourteenCenterMean = string.Empty; ThicknessFourteen3mmEdgeMean = string.Empty; @@ -372,7 +370,6 @@ public partial class ProcessData : IProcessData } else { - ThicknessFourteenPoints = string.Join(",", thicknessPoints); ReadOnlyCollection thicknessTenPoints = new(thicknessPoints.Take(10).ToArray()); double thicknessFourteenCriticalPointsAverage = thicknessTenPoints.Average(); // 15 double thicknessFourteenCriticalPointsStdDev = StandardDeviation(thicknessTenPoints); // 16 diff --git a/Adaptation/MET08THFTIRQS408M.Tests.csproj b/Adaptation/MET08THFTIRQS408M.Tests.csproj index 6b6bd8e..ef5be4c 100644 --- a/Adaptation/MET08THFTIRQS408M.Tests.csproj +++ b/Adaptation/MET08THFTIRQS408M.Tests.csproj @@ -8,10 +8,9 @@ disable false - 10.0 disable win-x64 - net7.0 + net8.0 trx @@ -43,27 +42,27 @@ NU1701 NU1701 - - - - - - - - - - - - - - + + + + + + + + + + + + + + NU1701 - - - + + + - - + + diff --git a/Adaptation/Shared/Duplicator/Description.cs b/Adaptation/Shared/Duplicator/Description.cs index ee6eb49..964612e 100644 --- a/Adaptation/Shared/Duplicator/Description.cs +++ b/Adaptation/Shared/Duplicator/Description.cs @@ -110,7 +110,7 @@ public class Description : IDescription, Properties.IDescription List IDescription.GetDescriptions(IFileRead fileRead, Logistics logistics, List tests, IProcessData iProcessData) { List results = new(); - if (iProcessData is null || !iProcessData.Details.Any()) + if (iProcessData is null || iProcessData.Details.Count == 0) results.Add(GetDefault(fileRead, logistics)); else { diff --git a/Adaptation/Shared/FileRead.cs b/Adaptation/Shared/FileRead.cs index a6c12ef..6788118 100644 --- a/Adaptation/Shared/FileRead.cs +++ b/Adaptation/Shared/FileRead.cs @@ -163,7 +163,7 @@ public class FileRead : Properties.IFileRead protected static ModelObjectParameterDefinition[] GetProperties(string cellInstanceConnectionName, IList modelObjectParameters, string propertyNamePrefix) { ModelObjectParameterDefinition[] results = (from l in modelObjectParameters where l.Name.StartsWith(propertyNamePrefix) select l).ToArray(); - if (!results.Any()) + if (results.Length == 0) throw new Exception(cellInstanceConnectionName); return results; } @@ -171,7 +171,7 @@ public class FileRead : Properties.IFileRead protected static ModelObjectParameterDefinition[] GetProperties(string cellInstanceConnectionName, IList modelObjectParameters, string propertyNamePrefix, string propertyNameSuffix) { ModelObjectParameterDefinition[] results = (from l in modelObjectParameters where l.Name.StartsWith(propertyNamePrefix) && l.Name.EndsWith(propertyNameSuffix) select l).ToArray(); - if (!results.Any()) + if (results.Length == 0) throw new Exception(cellInstanceConnectionName); return results; } @@ -203,7 +203,7 @@ public class FileRead : Properties.IFileRead } lock (threadExceptions) { - if (threadExceptions.Any()) + if (threadExceptions.Count != 0) { foreach (Exception item in threadExceptions) _Log.Error(string.Concat(item.Message, Environment.NewLine, Environment.NewLine, item.StackTrace)); @@ -241,7 +241,7 @@ public class FileRead : Properties.IFileRead if (!_IsDuplicator) WriteAllLines(to, results); } - if (extractResults is not null && extractResults.Item4 is not null && extractResults.Item4.Any()) + if (extractResults is not null && extractResults.Item4 is not null && extractResults.Item4.Count != 0) { string itemFile; List directories = new(); @@ -268,7 +268,7 @@ public class FileRead : Properties.IFileRead string dateValue; string rdsPlaceholder = "%RDS%"; string mesEntityPlaceholder = "%MesEntity%"; - if (!descriptions.Any() || string.IsNullOrEmpty(descriptions[0].RDS)) + if (descriptions.Count == 0 || string.IsNullOrEmpty(descriptions[0].RDS)) rds = logistics.MID; else rds = descriptions[0].RDS; @@ -312,7 +312,7 @@ public class FileRead : Properties.IFileRead preWait = dateTime.AddMilliseconds(1234).Ticks; else preWait = dateTime.AddMilliseconds(_FileConnectorConfiguration.FileHandleWaitTime.Value).Ticks; - if (!collection.Any()) + if (collection.Count == 0) duplicateFiles.Add(duplicateFile); string fileName = Path.GetFileNameWithoutExtension(logistics.ReportFullPath); string successFile = string.Concat(successDirectory, @"\", Path.GetFileName(logistics.ReportFullPath)); @@ -502,10 +502,10 @@ public class FileRead : Properties.IFileRead matches = Directory.GetFiles(_FileConnectorConfiguration.SourceFileLocation, segments.Last(), SearchOption.AllDirectories); else matches = Directory.GetFiles(_FileConnectorConfiguration.SourceFileLocation, segments.Last(), SearchOption.TopDirectoryOnly); - if (matches.Any()) + if (matches.Length != 0) break; } - if (matches is null || !matches.Any()) + if (matches is null || matches.Length == 0) results = null; else { @@ -588,13 +588,13 @@ public class FileRead : Properties.IFileRead { if (!checkDirectory.Contains('_')) continue; - if (Directory.GetDirectories(checkDirectory, "*", SearchOption.TopDirectoryOnly).Any()) + if (Directory.GetDirectories(checkDirectory, "*", SearchOption.TopDirectoryOnly).Length != 0) continue; - if (Directory.GetFiles(checkDirectory, "*", SearchOption.TopDirectoryOnly).Any()) + if (Directory.GetFiles(checkDirectory, "*", SearchOption.TopDirectoryOnly).Length != 0) continue; - if (Directory.GetDirectories(checkDirectory, "*", SearchOption.AllDirectories).Any()) + if (Directory.GetDirectories(checkDirectory, "*", SearchOption.AllDirectories).Length != 0) continue; - if (Directory.GetFiles(checkDirectory, "*", SearchOption.AllDirectories).Any()) + if (Directory.GetFiles(checkDirectory, "*", SearchOption.AllDirectories).Length != 0) continue; if (new DirectoryInfo(checkDirectory).CreationTime > dateTime) continue; @@ -611,7 +611,7 @@ public class FileRead : Properties.IFileRead { foreach (string directory in (from l in directories orderby l.Split('\\').Length descending select l).Distinct()) { - if (Directory.Exists(directory) && !Directory.GetFiles(directory).Any()) + if (Directory.Exists(directory) && Directory.GetFiles(directory).Length == 0) Directory.Delete(directory); } } diff --git a/Adaptation/Shared/Logistics.cs b/Adaptation/Shared/Logistics.cs index a6ca882..cb1f805 100644 --- a/Adaptation/Shared/Logistics.cs +++ b/Adaptation/Shared/Logistics.cs @@ -91,7 +91,7 @@ public class Logistics : ILogistics string[] segments; _FileInfo = new(reportFullPath); _Logistics1 = logistics.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).ToList(); - if (!Logistics1.Any() || !Logistics1[0].StartsWith("LOGISTICS_1")) + if (Logistics1.Count == 0 || !Logistics1[0].StartsWith("LOGISTICS_1")) { _NullData = null; _JobID = "null"; diff --git a/Adaptation/Shared/ProcessDataStandardFormat.cs b/Adaptation/Shared/ProcessDataStandardFormat.cs index b256f0f..e9691b1 100644 --- a/Adaptation/Shared/ProcessDataStandardFormat.cs +++ b/Adaptation/Shared/ProcessDataStandardFormat.cs @@ -23,7 +23,7 @@ public class ProcessDataStandardFormat public static string GetPDSFText(IFileRead fileRead, Logistics logistics, JsonElement[] jsonElements, string logisticsText) { string result; - if (!jsonElements.Any()) + if (jsonElements.Length == 0) result = string.Empty; else { @@ -146,7 +146,7 @@ public class ProcessDataStandardFormat string logistics = pdsf.Item1; string[] columns = pdsf.Item2; string[] bodyLines = pdsf.Item3; - if (!bodyLines.Any() || !bodyLines[0].Contains('\t')) + if (bodyLines.Length == 0 || !bodyLines[0].Contains('\t')) results = JsonSerializer.Deserialize("[]"); else { @@ -325,7 +325,7 @@ public class ProcessDataStandardFormat _ = line.Append(';'); } } - if (!pairedParameterNames.Any()) + if (pairedParameterNames.Count == 0) { _ = line.Remove(line.Length - 1, 1); _ = result.AppendLine(line.ToString()); diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.49.3/BIORAD2.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.49.3/BIORAD2.cs index cfd1910..a8ae31d 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.49.3/BIORAD2.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.49.3/BIORAD2.cs @@ -47,9 +47,7 @@ public class BIORAD2 : EAFLoggingUnitTesting EAFLoggingUnitTesting?.Dispose(); } -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__BIORAD2__QS408M() { diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.49.3/BIORAD3.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.49.3/BIORAD3.cs index efcf61c..c109c3f 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.49.3/BIORAD3.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.49.3/BIORAD3.cs @@ -47,9 +47,7 @@ public class BIORAD3 : EAFLoggingUnitTesting EAFLoggingUnitTesting?.Dispose(); } -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__BIORAD3__QS408M() { diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.49.3/MET08THFTIRQS408M.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.49.3/MET08THFTIRQS408M.cs index 9943f3e..eb2f14d 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.49.3/MET08THFTIRQS408M.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.49.3/MET08THFTIRQS408M.cs @@ -54,9 +54,7 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting catch (Exception) { } } -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__MoveMatchingFiles() { @@ -68,9 +66,7 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting NonThrowTryCatch(); } -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__OpenInsightMetrologyViewer() { @@ -82,9 +78,7 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting NonThrowTryCatch(); } -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__IQSSi() { @@ -96,9 +90,7 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting NonThrowTryCatch(); } -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__OpenInsight() { @@ -110,9 +102,7 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting NonThrowTryCatch(); } -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__OpenInsightMetrologyViewerAttachments() { @@ -124,9 +114,7 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting NonThrowTryCatch(); } -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__APC() { @@ -138,9 +126,7 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting NonThrowTryCatch(); } -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__SPaCe() { @@ -152,9 +138,7 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting NonThrowTryCatch(); } -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__Processed() { @@ -166,9 +150,7 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting NonThrowTryCatch(); } -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__Archive() { @@ -180,9 +162,7 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting NonThrowTryCatch(); } -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__Dummy() { diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.52.0/BIORAD2.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.52.0/BIORAD2.cs new file mode 100644 index 0000000..5c9aaf1 --- /dev/null +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.52.0/BIORAD2.cs @@ -0,0 +1,63 @@ +using Adaptation._Tests.Shared; +using Microsoft.Extensions.Logging; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Diagnostics; +using System.IO; +using System.Reflection; + +namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_52_0; + +[TestClass] +public class BIORAD2 : EAFLoggingUnitTesting +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + internal static string DummyRoot { get; private set; } + internal static BIORAD2 EAFLoggingUnitTesting { get; private set; } + + static BIORAD2() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy"; + + public BIORAD2() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) + { + if (EAFLoggingUnitTesting is null) + throw new Exception(); + } + + public BIORAD2(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + { + } + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + EAFLoggingUnitTesting ??= new BIORAD2(testContext); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize")); + string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName); + File.WriteAllText(fileNameAndText[0], fileNameAndText[1]); + File.WriteAllText(fileNameAndText[2], fileNameAndText[3]); + } + + [ClassCleanup()] + public static void ClassCleanup() + { + EAFLoggingUnitTesting?.Logger?.LogInformation("Cleanup"); + EAFLoggingUnitTesting?.Dispose(); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__BIORAD2__QS408M() + { + string check = "*.txt"; + MethodBase methodBase = new StackFrame().GetMethod(); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); + _ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + } + +} \ No newline at end of file diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.52.0/BIORAD3.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.52.0/BIORAD3.cs new file mode 100644 index 0000000..9630215 --- /dev/null +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.52.0/BIORAD3.cs @@ -0,0 +1,63 @@ +using Adaptation._Tests.Shared; +using Microsoft.Extensions.Logging; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Diagnostics; +using System.IO; +using System.Reflection; + +namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_52_0; + +[TestClass] +public class BIORAD3 : EAFLoggingUnitTesting +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + internal static string DummyRoot { get; private set; } + internal static BIORAD3 EAFLoggingUnitTesting { get; private set; } + + static BIORAD3() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy"; + + public BIORAD3() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) + { + if (EAFLoggingUnitTesting is null) + throw new Exception(); + } + + public BIORAD3(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + { + } + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + EAFLoggingUnitTesting ??= new BIORAD3(testContext); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize")); + string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName); + File.WriteAllText(fileNameAndText[0], fileNameAndText[1]); + File.WriteAllText(fileNameAndText[2], fileNameAndText[3]); + } + + [ClassCleanup()] + public static void ClassCleanup() + { + EAFLoggingUnitTesting?.Logger?.LogInformation("Cleanup"); + EAFLoggingUnitTesting?.Dispose(); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__BIORAD3__QS408M() + { + string check = "*.txt"; + MethodBase methodBase = new StackFrame().GetMethod(); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); + _ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + } + +} \ No newline at end of file diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.52.0/MET08THFTIRQS408M.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.52.0/MET08THFTIRQS408M.cs new file mode 100644 index 0000000..4f85eef --- /dev/null +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.52.0/MET08THFTIRQS408M.cs @@ -0,0 +1,197 @@ +using Adaptation._Tests.Shared; +using Microsoft.Extensions.Logging; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Diagnostics; +using System.IO; +using System.Reflection; + +namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_52_0; + +[TestClass] +public class MET08THFTIRQS408M : EAFLoggingUnitTesting +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + internal static string DummyRoot { get; private set; } + internal static MET08THFTIRQS408M EAFLoggingUnitTesting { get; private set; } + + static MET08THFTIRQS408M() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy"; + + public MET08THFTIRQS408M() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) + { + if (EAFLoggingUnitTesting is null) + throw new Exception(); + } + + public MET08THFTIRQS408M(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + { + } + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + EAFLoggingUnitTesting ??= new MET08THFTIRQS408M(testContext); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize")); + string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName); + File.WriteAllText(fileNameAndText[0], fileNameAndText[1]); + File.WriteAllText(fileNameAndText[2], fileNameAndText[3]); + } + + [ClassCleanup()] + public static void ClassCleanup() + { + EAFLoggingUnitTesting?.Logger?.LogInformation("Cleanup"); + EAFLoggingUnitTesting?.Dispose(); + } + + private static void NonThrowTryCatch() + { + try + { throw new Exception(); } + catch (Exception) { } + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__MoveMatchingFiles() + { + string check = "*.pdsf"; + MethodBase methodBase = new StackFrame().GetMethod(); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); + _ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + NonThrowTryCatch(); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__OpenInsightMetrologyViewer() + { + string check = "*.pdsf"; + MethodBase methodBase = new StackFrame().GetMethod(); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); + _ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + NonThrowTryCatch(); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__IQSSi() + { + string check = "*.pdsf"; + MethodBase methodBase = new StackFrame().GetMethod(); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); + _ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + NonThrowTryCatch(); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__OpenInsight() + { + string check = "*.pdsf"; + MethodBase methodBase = new StackFrame().GetMethod(); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); + _ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + NonThrowTryCatch(); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__OpenInsightMetrologyViewerAttachments() + { + string check = "*.pdsf"; + MethodBase methodBase = new StackFrame().GetMethod(); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); + _ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + NonThrowTryCatch(); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__APC() + { + string check = "*.pdsf"; + MethodBase methodBase = new StackFrame().GetMethod(); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); + _ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + NonThrowTryCatch(); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__SPaCe() + { + string check = "*.pdsf"; + MethodBase methodBase = new StackFrame().GetMethod(); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); + _ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + NonThrowTryCatch(); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__Processed() + { + string check = "*.pdsf"; + MethodBase methodBase = new StackFrame().GetMethod(); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); + _ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + NonThrowTryCatch(); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__Archive() + { + string check = "*.pdsf"; + MethodBase methodBase = new StackFrame().GetMethod(); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); + _ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + NonThrowTryCatch(); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__Dummy() + { + string check = "637406068146286000.zip"; + MethodBase methodBase = new StackFrame().GetMethod(); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); + _ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + NonThrowTryCatch(); + } + +} \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.49.3/BIORAD2.cs b/Adaptation/_Tests/Extract/Staging/v2.49.3/BIORAD2.cs index fd09d1e..5eefe4c 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.49.3/BIORAD2.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.49.3/BIORAD2.cs @@ -30,15 +30,11 @@ public class BIORAD2 catch (Exception) { } } -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__BIORAD2__QS408M() => _BIORAD2.Staging__v2_49_3__BIORAD2__QS408M(); -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__BIORAD2__QS408M638185231662401081__NinePoint() { @@ -58,9 +54,7 @@ public class BIORAD2 NonThrowTryCatch(); } -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__BIORAD2__QS408M638185291035612698__FourteenPoint() { @@ -80,9 +74,7 @@ public class BIORAD2 NonThrowTryCatch(); } -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__BIORAD2__QS408M638206292859940029__EpiPro() { @@ -102,9 +94,7 @@ public class BIORAD2 NonThrowTryCatch(); } -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__BIORAD2__QS408M638211310710952565__WMO() { diff --git a/Adaptation/_Tests/Extract/Staging/v2.49.3/BIORAD3.cs b/Adaptation/_Tests/Extract/Staging/v2.49.3/BIORAD3.cs index 375d73d..e0a2194 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.49.3/BIORAD3.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.49.3/BIORAD3.cs @@ -30,15 +30,11 @@ public class BIORAD3 catch (Exception) { } } -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__BIORAD3__QS408M() => _BIORAD3.Staging__v2_49_3__BIORAD3__QS408M(); -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__BIORAD3__QS408M637406016892454000__ReactorAndRDS() { @@ -58,9 +54,7 @@ public class BIORAD3 NonThrowTryCatch(); } -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__BIORAD3__QS408M638227775101723135__Error() { diff --git a/Adaptation/_Tests/Extract/Staging/v2.49.3/MET08THFTIRQS408M.cs b/Adaptation/_Tests/Extract/Staging/v2.49.3/MET08THFTIRQS408M.cs index 22b4b31..c99174a 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.49.3/MET08THFTIRQS408M.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.49.3/MET08THFTIRQS408M.cs @@ -23,33 +23,23 @@ public class MET08THFTIRQS408M _MET08THFTIRQS408M = CreateSelfDescription.Staging.v2_49_3.MET08THFTIRQS408M.EAFLoggingUnitTesting; } -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__MoveMatchingFiles() => _MET08THFTIRQS408M.Staging__v2_49_3__MET08THFTIRQS408M__MoveMatchingFiles(); -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__OpenInsightMetrologyViewer() => _MET08THFTIRQS408M.Staging__v2_49_3__MET08THFTIRQS408M__OpenInsightMetrologyViewer(); -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__IQSSi() => _MET08THFTIRQS408M.Staging__v2_49_3__MET08THFTIRQS408M__IQSSi(); -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__OpenInsight() => _MET08THFTIRQS408M.Staging__v2_49_3__MET08THFTIRQS408M__OpenInsight(); -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__OpenInsight638042558563679143__IqsSql() { @@ -67,39 +57,27 @@ public class MET08THFTIRQS408M _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics); } -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__OpenInsightMetrologyViewerAttachments() => _MET08THFTIRQS408M.Staging__v2_49_3__MET08THFTIRQS408M__OpenInsightMetrologyViewerAttachments(); -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__APC() => _MET08THFTIRQS408M.Staging__v2_49_3__MET08THFTIRQS408M__APC(); -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__SPaCe() => _MET08THFTIRQS408M.Staging__v2_49_3__MET08THFTIRQS408M__SPaCe(); -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__Processed() => _MET08THFTIRQS408M.Staging__v2_49_3__MET08THFTIRQS408M__Processed(); -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__Archive() => _MET08THFTIRQS408M.Staging__v2_49_3__MET08THFTIRQS408M__Archive(); -#if DEBUG [Ignore] -#endif [TestMethod] public void Staging__v2_49_3__MET08THFTIRQS408M__Dummy() => _MET08THFTIRQS408M.Staging__v2_49_3__MET08THFTIRQS408M__Dummy(); diff --git a/Adaptation/_Tests/Extract/Staging/v2.52.0/BIORAD2.cs b/Adaptation/_Tests/Extract/Staging/v2.52.0/BIORAD2.cs new file mode 100644 index 0000000..8557875 --- /dev/null +++ b/Adaptation/_Tests/Extract/Staging/v2.52.0/BIORAD2.cs @@ -0,0 +1,127 @@ +using Adaptation.Shared; +using Adaptation.Shared.Methods; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Diagnostics; +using System.Reflection; + +namespace Adaptation._Tests.Extract.Staging.v2_52_0; + +[TestClass] +public class BIORAD2 +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + private static CreateSelfDescription.Staging.v2_52_0.BIORAD2 _BIORAD2; + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + CreateSelfDescription.Staging.v2_52_0.BIORAD2.ClassInitialize(testContext); + _BIORAD2 = CreateSelfDescription.Staging.v2_52_0.BIORAD2.EAFLoggingUnitTesting; + } + + private static void NonThrowTryCatch() + { + try + { throw new Exception(); } + catch (Exception) { } + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__BIORAD2__QS408M() => _BIORAD2.Staging__v2_52_0__BIORAD2__QS408M(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__BIORAD2__QS408M638185231662401081__NinePoint() + { + DateTime dateTime; + string check = "*.txt"; + bool validatePDSF = false; + _BIORAD2.Staging__v2_52_0__BIORAD2__QS408M(); + MethodBase methodBase = new StackFrame().GetMethod(); + string[] variables = _BIORAD2.AdaptationTesting.GetVariables(methodBase, check, validatePDSF); + IFileRead fileRead = _BIORAD2.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); + Logistics logistics = new(fileRead); + dateTime = FileHandlers.QS408M.ProcessData.GetDateTime(logistics, tickOffset: 0, dateTimeText: string.Empty); + Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); + dateTime = FileHandlers.QS408M.ProcessData.GetDateTime(logistics, tickOffset: 0, dateTimeText: "Tue Nov 10 12:03:56 1970"); + Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); + _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics, validatePDSF); + NonThrowTryCatch(); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__BIORAD2__QS408M638185291035612698__FourteenPoint() + { + DateTime dateTime; + string check = "*.txt"; + bool validatePDSF = false; + _BIORAD2.Staging__v2_52_0__BIORAD2__QS408M(); + MethodBase methodBase = new StackFrame().GetMethod(); + string[] variables = _BIORAD2.AdaptationTesting.GetVariables(methodBase, check, validatePDSF); + IFileRead fileRead = _BIORAD2.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); + Logistics logistics = new(fileRead); + dateTime = FileHandlers.QS408M.ProcessData.GetDateTime(logistics, tickOffset: 0, dateTimeText: string.Empty); + Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); + dateTime = FileHandlers.QS408M.ProcessData.GetDateTime(logistics, tickOffset: 0, dateTimeText: "Tue Nov 10 12:03:56 1970"); + Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); + _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics, validatePDSF); + NonThrowTryCatch(); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__BIORAD2__QS408M638206292859940029__EpiPro() + { + DateTime dateTime; + string check = "*.txt"; + bool validatePDSF = false; + _BIORAD2.Staging__v2_52_0__BIORAD2__QS408M(); + MethodBase methodBase = new StackFrame().GetMethod(); + string[] variables = _BIORAD2.AdaptationTesting.GetVariables(methodBase, check, validatePDSF); + IFileRead fileRead = _BIORAD2.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); + Logistics logistics = new(fileRead); + dateTime = FileHandlers.QS408M.ProcessData.GetDateTime(logistics, tickOffset: 0, dateTimeText: string.Empty); + Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); + dateTime = FileHandlers.QS408M.ProcessData.GetDateTime(logistics, tickOffset: 0, dateTimeText: "Tue Nov 10 12:03:56 1970"); + Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); + _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics, validatePDSF); + NonThrowTryCatch(); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__BIORAD2__QS408M638211310710952565__WMO() + { + DateTime dateTime; + string check = "*.txt"; + bool validatePDSF = false; + _BIORAD2.Staging__v2_52_0__BIORAD2__QS408M(); + MethodBase methodBase = new StackFrame().GetMethod(); + string[] variables = _BIORAD2.AdaptationTesting.GetVariables(methodBase, check, validatePDSF); + IFileRead fileRead = _BIORAD2.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); + Logistics logistics = new(fileRead); + dateTime = FileHandlers.QS408M.ProcessData.GetDateTime(logistics, tickOffset: 0, dateTimeText: string.Empty); + Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); + dateTime = FileHandlers.QS408M.ProcessData.GetDateTime(logistics, tickOffset: 0, dateTimeText: "Tue Nov 10 12:03:56 1970"); + Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); + _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics, validatePDSF); + NonThrowTryCatch(); + } + +} \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.52.0/BIORAD3.cs b/Adaptation/_Tests/Extract/Staging/v2.52.0/BIORAD3.cs new file mode 100644 index 0000000..fa9b4a0 --- /dev/null +++ b/Adaptation/_Tests/Extract/Staging/v2.52.0/BIORAD3.cs @@ -0,0 +1,83 @@ +using Adaptation.Shared; +using Adaptation.Shared.Methods; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Diagnostics; +using System.Reflection; + +namespace Adaptation._Tests.Extract.Staging.v2_52_0; + +[TestClass] +public class BIORAD3 +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + private static CreateSelfDescription.Staging.v2_52_0.BIORAD3 _BIORAD3; + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + CreateSelfDescription.Staging.v2_52_0.BIORAD3.ClassInitialize(testContext); + _BIORAD3 = CreateSelfDescription.Staging.v2_52_0.BIORAD3.EAFLoggingUnitTesting; + } + + private static void NonThrowTryCatch() + { + try + { throw new Exception(); } + catch (Exception) { } + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__BIORAD3__QS408M() => _BIORAD3.Staging__v2_52_0__BIORAD3__QS408M(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__BIORAD3__QS408M637406016892454000__ReactorAndRDS() + { + DateTime dateTime; + string check = "*.txt"; + bool validatePDSF = false; + _BIORAD3.Staging__v2_52_0__BIORAD3__QS408M(); + MethodBase methodBase = new StackFrame().GetMethod(); + string[] variables = _BIORAD3.AdaptationTesting.GetVariables(methodBase, check); + IFileRead fileRead = _BIORAD3.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); + Logistics logistics = new(fileRead); + dateTime = FileHandlers.QS408M.ProcessData.GetDateTime(logistics, tickOffset: 0, dateTimeText: string.Empty); + Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); + dateTime = FileHandlers.QS408M.ProcessData.GetDateTime(logistics, tickOffset: 0, dateTimeText: "Tue Nov 10 12:03:56 1970"); + Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); + _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics, validatePDSF); + NonThrowTryCatch(); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__BIORAD3__QS408M638227775101723135__Error() + { + DateTime dateTime; + string check = "*.txt"; + bool validatePDSF = false; + _BIORAD3.Staging__v2_52_0__BIORAD3__QS408M(); + MethodBase methodBase = new StackFrame().GetMethod(); + string[] variables = _BIORAD3.AdaptationTesting.GetVariables(methodBase, check, validatePDSF); + IFileRead fileRead = _BIORAD3.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); + Logistics logistics = new(fileRead); + dateTime = FileHandlers.QS408M.ProcessData.GetDateTime(logistics, tickOffset: 0, dateTimeText: string.Empty); + Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); + dateTime = FileHandlers.QS408M.ProcessData.GetDateTime(logistics, tickOffset: 0, dateTimeText: "Tue Nov 10 12:03:56 1970"); + Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); + _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics, validatePDSF); + NonThrowTryCatch(); + } + +} \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.52.0/MET08THFTIRQS408M.cs b/Adaptation/_Tests/Extract/Staging/v2.52.0/MET08THFTIRQS408M.cs new file mode 100644 index 0000000..974a2b2 --- /dev/null +++ b/Adaptation/_Tests/Extract/Staging/v2.52.0/MET08THFTIRQS408M.cs @@ -0,0 +1,106 @@ +using Adaptation.Shared; +using Adaptation.Shared.Methods; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Diagnostics; +using System.Reflection; + +namespace Adaptation._Tests.Extract.Staging.v2_52_0; + +[TestClass] +public class MET08THFTIRQS408M +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + private static CreateSelfDescription.Staging.v2_52_0.MET08THFTIRQS408M _MET08THFTIRQS408M; + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + CreateSelfDescription.Staging.v2_52_0.MET08THFTIRQS408M.ClassInitialize(testContext); + _MET08THFTIRQS408M = CreateSelfDescription.Staging.v2_52_0.MET08THFTIRQS408M.EAFLoggingUnitTesting; + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__MoveMatchingFiles() => _MET08THFTIRQS408M.Staging__v2_52_0__MET08THFTIRQS408M__MoveMatchingFiles(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__OpenInsightMetrologyViewer() => _MET08THFTIRQS408M.Staging__v2_52_0__MET08THFTIRQS408M__OpenInsightMetrologyViewer(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__IQSSi() => _MET08THFTIRQS408M.Staging__v2_52_0__MET08THFTIRQS408M__IQSSi(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__OpenInsight() => _MET08THFTIRQS408M.Staging__v2_52_0__MET08THFTIRQS408M__OpenInsight(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__OpenInsight638042558563679143__IqsSql() + { + DateTime dateTime; + string check = "*.pdsf"; + MethodBase methodBase = new StackFrame().GetMethod(); + _MET08THFTIRQS408M.Staging__v2_52_0__MET08THFTIRQS408M__OpenInsight(); + string[] variables = _MET08THFTIRQS408M.AdaptationTesting.GetVariables(methodBase, check, validatePDSF: false); + IFileRead fileRead = _MET08THFTIRQS408M.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); + Logistics logistics = new(fileRead); + dateTime = FileHandlers.QS408M.ProcessData.GetDateTime(logistics, tickOffset: 0, dateTimeText: string.Empty); + Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); + dateTime = FileHandlers.QS408M.ProcessData.GetDateTime(logistics, tickOffset: 0, dateTimeText: "Tue Nov 10 12:03:56 1970"); + Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); + _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__OpenInsightMetrologyViewerAttachments() => _MET08THFTIRQS408M.Staging__v2_52_0__MET08THFTIRQS408M__OpenInsightMetrologyViewerAttachments(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__APC() => _MET08THFTIRQS408M.Staging__v2_52_0__MET08THFTIRQS408M__APC(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__SPaCe() => _MET08THFTIRQS408M.Staging__v2_52_0__MET08THFTIRQS408M__SPaCe(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__Processed() => _MET08THFTIRQS408M.Staging__v2_52_0__MET08THFTIRQS408M__Processed(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__Archive() => _MET08THFTIRQS408M.Staging__v2_52_0__MET08THFTIRQS408M__Archive(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_52_0__MET08THFTIRQS408M__Dummy() => _MET08THFTIRQS408M.Staging__v2_52_0__MET08THFTIRQS408M__Dummy(); + +} \ No newline at end of file diff --git a/Adaptation/_Tests/Shared/AdaptationTesting.cs b/Adaptation/_Tests/Shared/AdaptationTesting.cs index 0771b8b..2249c59 100644 --- a/Adaptation/_Tests/Shared/AdaptationTesting.cs +++ b/Adaptation/_Tests/Shared/AdaptationTesting.cs @@ -305,7 +305,7 @@ public class AdaptationTesting : ISMTP else { results = Directory.GetFiles(mbn.TextFileDirectory, "*.txt", SearchOption.TopDirectoryOnly); - if (!string.IsNullOrEmpty(mbn.Ticks) && _HasWaitForProperty && !results.Any()) + if (!string.IsNullOrEmpty(mbn.Ticks) && _HasWaitForProperty && results.Length == 0) { _ = Process.Start("explorer.exe", mbn.TextFileDirectory); File.WriteAllText(Path.Combine(mbn.TextFileDirectory, "_ Why.why"), string.Empty); @@ -401,7 +401,7 @@ public class AdaptationTesting : ISMTP } } } - if (!results.Any() || (!string.IsNullOrEmpty(cellInstanceConnectionName) && !results.ContainsKey(cellInstanceConnectionName))) + if (results.Count == 0 || (!string.IsNullOrEmpty(cellInstanceConnectionName) && !results.ContainsKey(cellInstanceConnectionName))) throw new Exception("Match not found (check test method name matches Mango)!"); return results; } @@ -596,7 +596,7 @@ public class AdaptationTesting : ISMTP throw new Exception(); _ = stringBuilder.Clear(); } - if (componentsCellComponentCellComponentEquipmentDictionaryNames.Any() && string.IsNullOrEmpty(cellInstanceVersion.FrozenBy)) + if (componentsCellComponentCellComponentEquipmentDictionaryNames.Count != 0 && string.IsNullOrEmpty(cellInstanceVersion.FrozenBy)) { if (!cellInstanceVersion.CellCommunicatingRule.EndsWith(".Communicating") || !(from l in componentsCellComponentCellComponentEquipmentNames where l == cellInstanceVersion.CellCommunicatingRule.Split('.')[0] select true).Any()) throw new Exception($"{methodName} - CellCommunicatingRule not correct in Mango!"); @@ -763,7 +763,7 @@ public class AdaptationTesting : ISMTP string[] results; string equipmentDictionaryName; string equipmentDictionaryVersionName; - if (_SkipEquipmentDictionary || equipmentTypeVersion?.EventActionSequences is null || !equipmentTypeVersion.EventActionSequences.Any() || !(from l in equipmentTypeVersion.EventActionSequences where l.HandledEvent.StartsWith("Equipment.FileRead") select 1).Any()) + if (_SkipEquipmentDictionary || equipmentTypeVersion?.EventActionSequences is null || equipmentTypeVersion.EventActionSequences.Length == 0 || !(from l in equipmentTypeVersion.EventActionSequences where l.HandledEvent.StartsWith("Equipment.FileRead") select 1).Any()) { equipmentDictionaryName = string.Empty; equipmentDictionaryVersionName = string.Empty; @@ -963,25 +963,33 @@ public class AdaptationTesting : ISMTP } if (_TestContext.FullyQualifiedTestClassName.Contains(nameof(Extract))) { - if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation)) + try { - if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation)) - _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation); + if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation)) + { + if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation)) + _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation); + } + if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.SourceFileLocation)) + { + if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.SourceFileLocation)) + _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.SourceFileLocation); + } + if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.TargetFileLocation)) + { + if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.TargetFileLocation)) + _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.TargetFileLocation); + } + if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder)) + { + if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder)) + _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder); + } } - if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.SourceFileLocation)) + catch (IOException ex) { - if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.SourceFileLocation)) - _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.SourceFileLocation); - } - if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.TargetFileLocation)) - { - if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.TargetFileLocation)) - _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.TargetFileLocation); - } - if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder)) - { - if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder)) - _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder); + if (!ex.Message.Contains("SMB1")) + throw; } } result = FileHandlers.CellInstanceConnectionName.Get(this, fileParameter, mbn.CellInstanceName, mbn.CellInstanceConnectionName, fileConnectorConfigurationTuple.Item2, equipmentTypeVersionTuple.Item2, parameterizedModelObjectDefinitionTypeTuple.Item2, modelObjectParametersTuple.Item2, equipmentDictionaryVersionTuple.Item2, dummyRuns, staticRuns, useCyclicalForDescription, connectionCount: cellInstanceVersionTuple.Item2.EquipmentConnections.Length); @@ -1001,7 +1009,7 @@ public class AdaptationTesting : ISMTP string sourceFileLocation = string.Empty; MethodBaseName mbn = GetMethodBaseName(methodBase); string[] textFiles = GetTextFiles(mbn); - if (!textFiles.Any()) + if (textFiles.Length == 0) { if (_HasWaitForProperty) throw new Exception("Set text file!"); @@ -1065,7 +1073,7 @@ public class AdaptationTesting : ISMTP else { string[] files = Directory.GetFiles(ipdsfDirectory, searchPattern, SearchOption.TopDirectoryOnly); - if (files.Any()) + if (files.Length != 0) ipdsfFile = files[0]; else ipdsfFile = searchPattern; @@ -1109,9 +1117,9 @@ public class AdaptationTesting : ISMTP { string[] pdsfFiles; pdsfFiles = Directory.GetFiles(searchDirectory, searchPattern, SearchOption.TopDirectoryOnly); - if (!pdsfFiles.Any()) + if (pdsfFiles.Length == 0) _ = Process.Start("explorer.exe", searchDirectory); - Assert.IsTrue(pdsfFiles.Any(), "GetFiles check"); + Assert.IsTrue(pdsfFiles.Length != 0, "GetFiles check"); results = GetLogisticsColumnsAndBody(pdsfFiles[0]); } Assert.IsFalse(string.IsNullOrEmpty(results.Item1)); diff --git a/Adaptation/_Tests/Shared/UnitTesting.cs b/Adaptation/_Tests/Shared/UnitTesting.cs index 1833834..e4ef794 100644 --- a/Adaptation/_Tests/Shared/UnitTesting.cs +++ b/Adaptation/_Tests/Shared/UnitTesting.cs @@ -2,7 +2,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Diagnostics; using System.IO; -using System.Linq; using System.Reflection; using System.Text; using System.Text.Json; @@ -74,7 +73,7 @@ public class UnitTesting if (string.IsNullOrEmpty(result)) break; checkFiles = Directory.GetFiles(result, "*.Tests.*proj", SearchOption.TopDirectoryOnly); - if (checkFiles.Any()) + if (checkFiles.Length != 0) break; result = Path.GetDirectoryName(result); } diff --git a/Adaptation/_Tests/Static/MET08THFTIRQS408M.cs b/Adaptation/_Tests/Static/MET08THFTIRQS408M.cs index d687c62..6397782 100644 --- a/Adaptation/_Tests/Static/MET08THFTIRQS408M.cs +++ b/Adaptation/_Tests/Static/MET08THFTIRQS408M.cs @@ -55,7 +55,7 @@ public class MET08THFTIRQS408M : LoggingUnitTesting, IDisposable StringBuilder results = new(); (string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[] { - new("MET08THFTIRQS408M", "v2.49.2"), + new("MET08THFTIRQS408M", "v2.52.0"), }; string staging = "http://mestsa07ec.infineon.com:9003/CellInstanceServiceV2"; Shared.PasteSpecialXml.EAF.XML.API.CellInstance.CellInstanceVersion cellInstanceVersion; diff --git a/Adaptation/_Tests/Static/QS408M.cs b/Adaptation/_Tests/Static/QS408M.cs index 582f138..c090794 100644 --- a/Adaptation/_Tests/Static/QS408M.cs +++ b/Adaptation/_Tests/Static/QS408M.cs @@ -205,8 +205,8 @@ public class QS408M : LoggingUnitTesting, IDisposable StringBuilder results = new(); (string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[] { - new("BIORAD2", "v2.49.2"), - new("BIORAD3", "v2.49.2"), + new("BIORAD2", "v2.52.0"), + new("BIORAD3", "v2.52.0"), }; string staging = "http://mestsa07ec.infineon.com:9003/CellInstanceServiceV2"; Shared.PasteSpecialXml.EAF.XML.API.CellInstance.CellInstanceVersion cellInstanceVersion; diff --git a/MET08THFTIRQS408M.csproj b/MET08THFTIRQS408M.csproj index 05c648b..a65892c 100644 --- a/MET08THFTIRQS408M.csproj +++ b/MET08THFTIRQS408M.csproj @@ -168,7 +168,7 @@ - 2.49.3 + 2.52.0 6.0.3 diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index d564be1..e1be338 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.49.3.0")] -[assembly: AssemblyFileVersion("2.49.3.0")] +[assembly: AssemblyVersion("2.52.0.0")] +[assembly: AssemblyFileVersion("2.52.0.0")]