diff --git a/.gitignore b/.gitignore index 6ba6148..eab1f67 100644 --- a/.gitignore +++ b/.gitignore @@ -336,3 +336,5 @@ ASALocalRun/ !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json + +*.lnk diff --git a/Adaptation/.vscode/launch.json b/Adaptation/.vscode/launch.json index 9ac94f5..676453a 100644 --- a/Adaptation/.vscode/launch.json +++ b/Adaptation/.vscode/launch.json @@ -4,7 +4,7 @@ "name": ".NET Core Attach", "type": "coreclr", "request": "attach", - "processId": 13708 + "processId": 10724 } ] } diff --git a/Adaptation/FileHandlers/OpenInsightMetrologyViewer/BarcodeDevice.cs b/Adaptation/FileHandlers/OpenInsightMetrologyViewer/BarcodeDevice.cs new file mode 100644 index 0000000..ff40fd7 --- /dev/null +++ b/Adaptation/FileHandlers/OpenInsightMetrologyViewer/BarcodeDevice.cs @@ -0,0 +1,34 @@ +using System.Text.Json.Serialization; + +namespace Adaptation.FileHandlers.OpenInsightMetrologyViewer; + +public class BarcodeDevice : IBarcodeDevice +{ + + protected string _Name; + protected string _Path; + protected string _ProductId; + protected string _VendorId; + public string Name => _Name; + public string Path => _Path; + public string ProductId => _ProductId; + public string VendorId => _VendorId; + + public BarcodeDevice() + { + _Name = string.Empty; + _Path = string.Empty; + _ProductId = string.Empty; + _VendorId = string.Empty; + } + + [JsonConstructor] + public BarcodeDevice(string name, string path, string productId, string vendorId) + { + _Name = name; + _Path = path; + _ProductId = productId; + _VendorId = vendorId; + } + +} \ No newline at end of file diff --git a/Adaptation/FileHandlers/OpenInsightMetrologyViewer/BarcodeRecord.cs b/Adaptation/FileHandlers/OpenInsightMetrologyViewer/BarcodeRecord.cs new file mode 100644 index 0000000..e6a489f --- /dev/null +++ b/Adaptation/FileHandlers/OpenInsightMetrologyViewer/BarcodeRecord.cs @@ -0,0 +1,38 @@ +using System.Text.Json.Serialization; + +namespace Adaptation.FileHandlers.OpenInsightMetrologyViewer; + +public class BarcodeRecord : IBarcodeRecord +{ + + protected string _Barcode; + protected string _Date; + protected BarcodeDevice _Device; + protected string _Id; + protected string _ServerId; + public string Barcode => _Barcode; + public string Date => _Date; + public BarcodeDevice Device => _Device; + public string Id => _Id; + public string ServerId => _ServerId; + + public BarcodeRecord() + { + _Barcode = string.Empty; + _Date = string.Empty; + _Device = new BarcodeDevice(); + _Id = string.Empty; + _ServerId = string.Empty; + } + + [JsonConstructor] + public BarcodeRecord(string barcode, string date, BarcodeDevice device, string id, string serverId) + { + _Barcode = barcode; + _Date = date; + _Device = device; + _Id = id; + _ServerId = serverId; + } + +} \ No newline at end of file diff --git a/Adaptation/FileHandlers/OpenInsightMetrologyViewer/FileRead.cs b/Adaptation/FileHandlers/OpenInsightMetrologyViewer/FileRead.cs index c7212a3..16c95fd 100644 --- a/Adaptation/FileHandlers/OpenInsightMetrologyViewer/FileRead.cs +++ b/Adaptation/FileHandlers/OpenInsightMetrologyViewer/FileRead.cs @@ -30,6 +30,9 @@ public class FileRead : Shared.FileRead, IFileRead if (!_IsDuplicator) throw new Exception(cellInstanceConnectionName); _OpenInsightMetrologyViewerAPI = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "OpenInsight.MetrologyViewerAPI"); + string barcode = TestMe.GetBarcode("192.168.0.121"); + if (string.IsNullOrEmpty(barcode)) + { } } void IFileRead.Move(Tuple> extractResults, Exception exception) diff --git a/Adaptation/FileHandlers/OpenInsightMetrologyViewer/IBarcodeDevice.cs b/Adaptation/FileHandlers/OpenInsightMetrologyViewer/IBarcodeDevice.cs new file mode 100644 index 0000000..f884dfb --- /dev/null +++ b/Adaptation/FileHandlers/OpenInsightMetrologyViewer/IBarcodeDevice.cs @@ -0,0 +1,11 @@ +namespace Adaptation.FileHandlers.OpenInsightMetrologyViewer; + +public interface IBarcodeDevice +{ + + public string Name { get; } + public string Path { get; } + public string VendorId { get; } + public string ProductId { get; } + +} \ No newline at end of file diff --git a/Adaptation/FileHandlers/OpenInsightMetrologyViewer/IBarcodeRecord.cs b/Adaptation/FileHandlers/OpenInsightMetrologyViewer/IBarcodeRecord.cs new file mode 100644 index 0000000..9f76ee9 --- /dev/null +++ b/Adaptation/FileHandlers/OpenInsightMetrologyViewer/IBarcodeRecord.cs @@ -0,0 +1,12 @@ +namespace Adaptation.FileHandlers.OpenInsightMetrologyViewer; + +public interface IBarcodeRecord +{ + + public string Barcode { get; } + public string Date { get; } + public BarcodeDevice Device { get; } + public string Id { get; } + public string ServerId { get; } + +} \ No newline at end of file diff --git a/Adaptation/FileHandlers/OpenInsightMetrologyViewer/NginxFileSystem.cs b/Adaptation/FileHandlers/OpenInsightMetrologyViewer/NginxFileSystem.cs new file mode 100644 index 0000000..f37cd61 --- /dev/null +++ b/Adaptation/FileHandlers/OpenInsightMetrologyViewer/NginxFileSystem.cs @@ -0,0 +1,11 @@ +namespace Adaptation.FileHandlers.OpenInsightMetrologyViewer; + +internal class NginxFileSystem +{ + + public string Name { get; set; } + public string Type { get; set; } + public string MTime { get; set; } + public float Size { get; set; } + +} \ No newline at end of file diff --git a/Adaptation/FileHandlers/OpenInsightMetrologyViewer/TestMe.cs b/Adaptation/FileHandlers/OpenInsightMetrologyViewer/TestMe.cs new file mode 100644 index 0000000..da8b5ad --- /dev/null +++ b/Adaptation/FileHandlers/OpenInsightMetrologyViewer/TestMe.cs @@ -0,0 +1,105 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Net.Http; +using System.Text.Json; + +namespace Adaptation.FileHandlers.OpenInsightMetrologyViewer; + +public class TestMe +{ + + private static List GetURLCollection(string barcodeServerIP) + { + List results = new(); + int weekOfYear; + string checkURL; + DateTime dateTime; + string weekDirectory; + string weekOfYearPadded; + string lastURL = string.Empty; + Calendar calendar = new CultureInfo("en-US").Calendar; + for (int i = 1; i < 3; i++) + { + if (i == 1) + dateTime = DateTime.Now; + else + dateTime = DateTime.Now.AddHours(-4); + weekOfYear = calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday) - 1; + weekOfYearPadded = weekOfYear.ToString("00"); + weekDirectory = $"{dateTime:yyyy}_Week_{weekOfYearPadded}/{dateTime:yyyy-MM-dd}"; + checkURL = string.Concat("http://", barcodeServerIP, '/', weekDirectory); + if (i == 1 || checkURL != lastURL) + { + results.Add(string.Concat(checkURL, "/A")); + results.Add(string.Concat(checkURL, "/B")); + } + lastURL = checkURL; + } + return results; + } + + private static List GetURLPossible(HttpClient httpClient, List urlCollection, JsonSerializerOptions propertyNameCaseInsensitiveJsonSerializerOptions) + { + List results = new(); + string json; + NginxFileSystem[] nginxFileSystemCollection; + DateTime minimumDateTime = DateTime.Now.AddHours(-4); + string nginxFormat = "ddd, dd MMM yyyy HH:mm:ss zzz"; + foreach (string url in urlCollection) + { + try + { + json = httpClient.GetStringAsync(url).Result; + nginxFileSystemCollection = JsonSerializer.Deserialize(json, propertyNameCaseInsensitiveJsonSerializerOptions); + foreach (NginxFileSystem nginxFileSystem in nginxFileSystemCollection) + { + if (!DateTime.TryParseExact(nginxFileSystem.MTime.Replace("GMT", "+00:00"), nginxFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime dateTime)) + continue; + if (dateTime < minimumDateTime) + continue; + results.Add(string.Concat(url, '/', nginxFileSystem.Name)); + } + } + catch + { } + } + return results; + } + + private static List<(string, BarcodeRecord)> GetBarcodePossible(HttpClient httpClient, JsonSerializerOptions propertyNameCaseInsensitiveJsonSerializerOptions, List possibleURLCollection) + { + List<(string, BarcodeRecord)> results = new(); + string json; + BarcodeRecord barcodeRecord; + foreach (string possibleURL in possibleURLCollection) + { + try + { + json = httpClient.GetStringAsync(possibleURL).Result; + barcodeRecord = JsonSerializer.Deserialize(json, propertyNameCaseInsensitiveJsonSerializerOptions); + results.Add(new(possibleURL, barcodeRecord)); + } + catch + { } + } + return results; + } + + public static string GetBarcode(string barcodeServerIP) + { + string result = string.Empty; + using HttpClient httpClient = new(); + List urlCollection = GetURLCollection(barcodeServerIP); + JsonSerializerOptions propertyNameCaseInsensitiveJsonSerializerOptions = new() { PropertyNameCaseInsensitive = true }; + List possibleURLCollection = GetURLPossible(httpClient, urlCollection, propertyNameCaseInsensitiveJsonSerializerOptions); + List<(string, BarcodeRecord)> possibleBarcodeCollection = GetBarcodePossible(httpClient, propertyNameCaseInsensitiveJsonSerializerOptions, possibleURLCollection); + foreach ((string url, BarcodeRecord barcodeRecord) in possibleBarcodeCollection) + { + if (string.IsNullOrEmpty(url) || string.IsNullOrEmpty(barcodeRecord.Barcode)) + continue; + } + return result; + } + +} \ No newline at end of file diff --git a/Adaptation/FileHandlers/OpenInsightMetrologyViewer/WSRequest.cs b/Adaptation/FileHandlers/OpenInsightMetrologyViewer/WSRequest.cs index 591ea06..7240ea0 100644 --- a/Adaptation/FileHandlers/OpenInsightMetrologyViewer/WSRequest.cs +++ b/Adaptation/FileHandlers/OpenInsightMetrologyViewer/WSRequest.cs @@ -117,6 +117,7 @@ public class WSRequest RDS = x.RDS; Reactor = x.Reactor; Recipe = x.Recipe; + Operator = x.Employee; ScratchCountAvg = x.ScratchCountAvg; ScratchCountMax = x.ScratchCountMax; ScratchCountMin = x.ScratchCountMin; diff --git a/Adaptation/FileHandlers/pcl/Description.cs b/Adaptation/FileHandlers/pcl/Description.cs index b343026..501da60 100644 --- a/Adaptation/FileHandlers/pcl/Description.cs +++ b/Adaptation/FileHandlers/pcl/Description.cs @@ -301,7 +301,7 @@ public class Description : IDescription, Shared.Properties.IDescription MID = logistics.MID, // Date = processData.Date, - Employee = processData.PSN, + Employee = processData.Employee, Lot = processData.Lot, PSN = processData.PSN, Reactor = processData.Reactor, diff --git a/Adaptation/FileHandlers/pcl/Descriptor.cs b/Adaptation/FileHandlers/pcl/Descriptor.cs new file mode 100644 index 0000000..a5d9037 --- /dev/null +++ b/Adaptation/FileHandlers/pcl/Descriptor.cs @@ -0,0 +1,21 @@ +namespace Adaptation.FileHandlers.pcl; + +public class Descriptor +{ + + public string Employee { get; private set; } + public string Lot { get; private set; } + public string PSN { get; private set; } + public string RDS { get; private set; } + public string Reactor { get; private set; } + + public Descriptor(string employee, string lot, string psn, string rds, string reactor) + { + Employee = employee; + Lot = lot; + PSN = psn; + RDS = rds; + Reactor = reactor; + } + +} \ No newline at end of file diff --git a/Adaptation/FileHandlers/pcl/FileRead.cs b/Adaptation/FileHandlers/pcl/FileRead.cs index a7a210e..7257d21 100644 --- a/Adaptation/FileHandlers/pcl/FileRead.cs +++ b/Adaptation/FileHandlers/pcl/FileRead.cs @@ -110,8 +110,14 @@ public class FileRead : Shared.FileRead, IFileRead IProcessData iProcessData = new ProcessData(this, _Logistics, results.Item4, _GhostPCLFileName); if (iProcessData is not ProcessData processData) throw new Exception(string.Concat("A) No Data - ", dateTime.Ticks)); - string mid = string.Concat(processData.Reactor, "-", processData.RDS, "-", processData.PSN); - mid = Regex.Replace(mid, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0]; + string mid; + if (!string.IsNullOrEmpty(processData.Employee) && string.IsNullOrEmpty(processData.Reactor) && string.IsNullOrEmpty(processData.RDS) && string.IsNullOrEmpty(processData.PSN)) + mid = processData.Employee; + else + { + mid = string.Concat(processData.Reactor, "-", processData.RDS, "-", processData.PSN); + mid = Regex.Replace(mid, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0]; + } SetFileParameterLotID(mid); _Logistics.Update(mid, processData.Reactor); if (!iProcessData.Details.Any()) diff --git a/Adaptation/FileHandlers/pcl/ProcessData.cs b/Adaptation/FileHandlers/pcl/ProcessData.cs index 061607e..d2affaf 100644 --- a/Adaptation/FileHandlers/pcl/ProcessData.cs +++ b/Adaptation/FileHandlers/pcl/ProcessData.cs @@ -33,6 +33,7 @@ public class ProcessData : IProcessData public string AreaTotalMin { get; set; } public string AreaTotalStdDev { get; set; } public string Date { get; set; } + public string Employee { get; set; } public string HazeAverageAvg { get; set; } public string HazeAverageMax { get; set; } public string HazeAverageMin { get; set; } @@ -50,8 +51,8 @@ public class ProcessData : IProcessData public string LPDCountMin { get; set; } public string LPDCountStdDev { get; set; } public string Lot { get; set; } - public string ParseErrorText { get; set; } public string PSN { get; set; } + public string ParseErrorText { get; set; } public string RDS { get; set; } public string Reactor { get; set; } public string Recipe { get; set; } @@ -249,6 +250,88 @@ public class ProcessData : IProcessData return toEol; } + public static Descriptor GetDescriptor(string text) + { + Descriptor result; + string lot; + string rds; + string psn; + string reactor; + string employee; + const string defaultPSN = "0000"; + const string defaultReactor = "00"; + const string defaultRDS = "000000"; + if (text.Length is 2 or 3) + { + lot = text; + employee = text; + rds = defaultRDS; + psn = defaultPSN; + reactor = defaultReactor; + } + else + { + // Remove illegal characters \/:*?"<>| found in the Lot. + lot = Regex.Replace(text, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0]; + string[] segments = lot.Split('-'); + if (segments.Length == 0) + reactor = defaultReactor; + else + reactor = segments[0]; + if (segments.Length <= 1) + rds = defaultRDS; + else + rds = segments[1]; + if (reactor.Length > 3) + { + rds = reactor; + reactor = defaultReactor; + } + if (segments.Length <= 2) + psn = defaultPSN; + else + psn = segments[2]; + if (segments.Length <= 3) + employee = string.Empty; + else + employee = segments[3]; + } + result = new(employee, lot, psn, rds, reactor); + return result; + } + + private void Set(ILogistics logistics) + { + string lot; + string rds; + string psn; + string recipe; + string reactor; + string employee; + ScanPast("Recipe ID:"); + recipe = GetBefore("LotID:"); + recipe = recipe.Replace(";", ""); + if (_Data.Contains("[]")) + lot = GetBefore("[]"); + else if (_Data.Contains("[7]")) + lot = GetBefore("[7]"); + else + lot = GetBefore("["); + Descriptor descriptor = GetDescriptor(lot); + lot = descriptor.Lot; + psn = descriptor.PSN; + rds = descriptor.RDS; + reactor = descriptor.Reactor; + employee = descriptor.Employee; + Lot = lot; + PSN = psn; + RDS = rds; + Recipe = recipe; + Reactor = reactor; + Employee = employee; + UniqueId = string.Format("{0}_{1}_{2}", logistics.JobID, lot, Path.GetFileNameWithoutExtension(logistics.ReportFullPath)); + } + private void ParseLotSummary(IFileRead fileRead, ILogistics logistics, string headerFileName, Dictionary pages, Dictionary> slots) { if (fileRead is null) @@ -261,19 +344,7 @@ public class ProcessData : IProcessData _Data = pages[headerFileName]; ScanPast("Date:"); Date = GetToEOL(); - ScanPast("Recipe ID:"); - Recipe = GetBefore("LotID:"); - Recipe = Recipe.Replace(";", ""); - if (_Data.Contains("[]")) - Lot = GetBefore("[]"); - else if (_Data.Contains("[7]")) - Lot = GetBefore("[7]"); - else - Lot = GetBefore("["); - - // Remove illegal characters \/:*?"<>| found in the Lot. - Lot = Regex.Replace(Lot, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0]; - + Set(logistics); // determine number of wafers and their slot numbers _Log.Debug(_Data.Substring(_I)); string slot; @@ -347,16 +418,6 @@ public class ProcessData : IProcessData SumOfDefectsStdDev = toEol4[6].Trim(); HazeRegionStdDev = toEol4[7].Trim(); HazeAverageStdDev = toEol4[8].Trim(); - - string[] segments = Lot.Split('-'); - if (segments.Length > 0) - Reactor = segments[0]; - if (segments.Length > 1) - RDS = segments[1]; - if (segments.Length > 2) - PSN = segments[2]; - // Example of header.UniqueId is TENCOR1_33-289217-4693_201901300556533336 - UniqueId = string.Format("{0}_{1}_{2}", logistics.JobID, Lot, Path.GetFileNameWithoutExtension(logistics.ReportFullPath)); } private Detail ParseWaferSummary(string waferFileName, Dictionary pages) diff --git a/Adaptation/Shared/FileRead.cs b/Adaptation/Shared/FileRead.cs index d01861a..9e02131 100644 --- a/Adaptation/Shared/FileRead.cs +++ b/Adaptation/Shared/FileRead.cs @@ -54,6 +54,7 @@ public class FileRead : Properties.IFileRead string Properties.IFileRead.EventName => _EventName; string Properties.IFileRead.MesEntity => _MesEntity; bool Properties.IFileRead.IsEAFHosted => _IsEAFHosted; + bool Properties.IFileRead.IsDuplicator => _IsDuplicator; string Properties.IFileRead.EquipmentType => _EquipmentType; string Properties.IFileRead.ReportFullPath => _ReportFullPath; string Properties.IFileRead.CellInstanceName => _CellInstanceName; diff --git a/Adaptation/Shared/Properties/IFileRead.cs b/Adaptation/Shared/Properties/IFileRead.cs index 2e85ac9..5cf9a69 100644 --- a/Adaptation/Shared/Properties/IFileRead.cs +++ b/Adaptation/Shared/Properties/IFileRead.cs @@ -7,6 +7,7 @@ public interface IFileRead string MesEntity { get; } bool IsEAFHosted { get; } string EventName { get; } + bool IsDuplicator { get; } string EquipmentType { get; } string ReportFullPath { get; } string CellInstanceName { get; } diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.36.3/TENCOR1.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.36.3/TENCOR1.cs index 5fc150a..a7eaf3c 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.36.3/TENCOR1.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.36.3/TENCOR1.cs @@ -15,15 +15,16 @@ public class TENCOR1 : EAFLoggingUnitTesting #pragma warning disable CA2254 #pragma warning disable IDE0060 + internal static string DummyRoot { get; private set; } internal static TENCOR1 EAFLoggingUnitTesting { get; private set; } - public TENCOR1() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false) + public TENCOR1() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) { if (EAFLoggingUnitTesting is null) throw new Exception(); } - public TENCOR1(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + public TENCOR1(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) { } @@ -47,6 +48,9 @@ public class TENCOR1 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Dispose(); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_36_3__TENCOR1__MET08DDUPSFS6420() { diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/MET08DDUPSFS6420.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/MET08DDUPSFS6420.cs index 372fb5d..de03ada 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/MET08DDUPSFS6420.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/MET08DDUPSFS6420.cs @@ -15,15 +15,18 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting #pragma warning disable CA2254 #pragma warning disable IDE0060 + internal static string DummyRoot { get; private set; } internal static MET08DDUPSFS6420 EAFLoggingUnitTesting { get; private set; } - public MET08DDUPSFS6420() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false) + static MET08DDUPSFS6420() => DummyRoot = @"\\messv02ecc1.ec.local\EC_Characterization_Si\Dummy"; + + public MET08DDUPSFS6420() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) { if (EAFLoggingUnitTesting is null) throw new Exception(); } - public MET08DDUPSFS6420(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + public MET08DDUPSFS6420(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) { } @@ -47,6 +50,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Dispose(); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420() { @@ -57,6 +63,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420_() { @@ -67,6 +76,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420__() { @@ -77,6 +89,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420___() { @@ -87,6 +102,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420____() { @@ -97,6 +115,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420_____() { @@ -107,6 +128,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420______() { @@ -117,6 +141,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420_______() { @@ -127,6 +154,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420________() { @@ -137,6 +167,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420_________() { @@ -147,6 +180,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420__________() { diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/TENCOR1.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/TENCOR1.cs index 13d9a41..b98cec5 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/TENCOR1.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/TENCOR1.cs @@ -14,15 +14,16 @@ public class TENCOR1 : EAFLoggingUnitTesting #pragma warning disable CA2254 #pragma warning disable IDE0060 + internal static string DummyRoot { get; private set; } internal static TENCOR1 EAFLoggingUnitTesting { get; private set; } - public TENCOR1() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false) + public TENCOR1() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) { if (EAFLoggingUnitTesting is null) throw new Exception(); } - public TENCOR1(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + public TENCOR1(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) { } @@ -46,6 +47,9 @@ public class TENCOR1 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Dispose(); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__TENCOR1__() { diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/TENCOR2.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/TENCOR2.cs index 20a27d5..622b655 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/TENCOR2.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/TENCOR2.cs @@ -14,15 +14,16 @@ public class TENCOR2 : EAFLoggingUnitTesting #pragma warning disable CA2254 #pragma warning disable IDE0060 + internal static string DummyRoot { get; private set; } internal static TENCOR2 EAFLoggingUnitTesting { get; private set; } - public TENCOR2() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false) + public TENCOR2() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) { if (EAFLoggingUnitTesting is null) throw new Exception(); } - public TENCOR2(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + public TENCOR2(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) { } @@ -46,6 +47,9 @@ public class TENCOR2 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Dispose(); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__TENCOR2__() { diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/TENCOR3-EQPT.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/TENCOR3-EQPT.cs index cd1f62d..f27e96c 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/TENCOR3-EQPT.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/TENCOR3-EQPT.cs @@ -15,15 +15,16 @@ public class TENCOR3_EQPT : EAFLoggingUnitTesting #pragma warning disable CA2254 #pragma warning disable IDE0060 + internal static string DummyRoot { get; private set; } internal static TENCOR3_EQPT EAFLoggingUnitTesting { get; private set; } - public TENCOR3_EQPT() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false) + public TENCOR3_EQPT() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) { if (EAFLoggingUnitTesting is null) throw new Exception(); } - public TENCOR3_EQPT(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + public TENCOR3_EQPT(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) { } @@ -47,6 +48,9 @@ public class TENCOR3_EQPT : EAFLoggingUnitTesting EAFLoggingUnitTesting.Dispose(); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__TENCOR3_EQPT__DownloadRsMFile() { diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/TENCOR3.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/TENCOR3.cs index c13f6ae..cb07f6e 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/TENCOR3.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.0/TENCOR3.cs @@ -15,15 +15,16 @@ public class TENCOR3 : EAFLoggingUnitTesting #pragma warning disable CA2254 #pragma warning disable IDE0060 + internal static string DummyRoot { get; private set; } internal static TENCOR3 EAFLoggingUnitTesting { get; private set; } - public TENCOR3() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false) + public TENCOR3() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) { if (EAFLoggingUnitTesting is null) throw new Exception(); } - public TENCOR3(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + public TENCOR3(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) { } @@ -47,6 +48,9 @@ public class TENCOR3 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Dispose(); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__TENCOR3__RsM() { diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/MET08DDUPSFS6420.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/MET08DDUPSFS6420.cs index ceef664..5499e4b 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/MET08DDUPSFS6420.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/MET08DDUPSFS6420.cs @@ -15,15 +15,16 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting #pragma warning disable CA2254 #pragma warning disable IDE0060 + internal static string DummyRoot { get; private set; } internal static MET08DDUPSFS6420 EAFLoggingUnitTesting { get; private set; } - public MET08DDUPSFS6420() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false) + public MET08DDUPSFS6420() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) { if (EAFLoggingUnitTesting is null) throw new Exception(); } - public MET08DDUPSFS6420(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + public MET08DDUPSFS6420(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) { } @@ -47,6 +48,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Dispose(); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_43_0__MET08DDUPSFS6420__MoveMatchingFiles() { @@ -57,6 +61,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_43_0__MET08DDUPSFS6420__OpenInsightMetrologyViewer() { @@ -67,6 +74,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_43_0__MET08DDUPSFS6420__IQSSi() { @@ -77,6 +87,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_43_0__MET08DDUPSFS6420__OpenInsight() { @@ -87,6 +100,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_43_0__MET08DDUPSFS6420__OpenInsightMetrologyViewerAttachments() { @@ -97,6 +113,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_43_0__MET08DDUPSFS6420__APC() { @@ -107,6 +126,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_43_0__MET08DDUPSFS6420__SPaCe() { @@ -117,6 +139,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_43_0__MET08DDUPSFS6420__Processed() { @@ -127,6 +152,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_43_0__MET08DDUPSFS6420__Archive() { @@ -137,6 +165,9 @@ public class MET08DDUPSFS6420 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_43_0__MET08DDUPSFS6420__Dummy() { diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/TENCOR1.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/TENCOR1.cs deleted file mode 100644 index ad6c983..0000000 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/TENCOR1.cs +++ /dev/null @@ -1,54 +0,0 @@ -using Adaptation._Tests.Shared; -using Microsoft.Extensions.Logging; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; -using System.Diagnostics; -using System.IO; - -namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_43_0; - -[TestClass] -public class TENCOR1 : EAFLoggingUnitTesting -{ - -#pragma warning disable CA2254 -#pragma warning disable IDE0060 - - internal static TENCOR1 EAFLoggingUnitTesting { get; private set; } - - public TENCOR1() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false) - { - if (EAFLoggingUnitTesting is null) - throw new Exception(); - } - - public TENCOR1(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) - { - } - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - if (EAFLoggingUnitTesting is null) - EAFLoggingUnitTesting = new TENCOR1(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() - { - if (EAFLoggingUnitTesting.Logger is not null) - EAFLoggingUnitTesting.Logger.LogInformation("Cleanup"); - if (EAFLoggingUnitTesting is not null) - EAFLoggingUnitTesting.Dispose(); - } - - [TestMethod] - public void Staging__v2_43_0__TENCOR1__() - { - } - -} \ No newline at end of file diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.4/MET08DDUPSFS6420.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.4/MET08DDUPSFS6420.cs new file mode 100644 index 0000000..7adeb5a --- /dev/null +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.4/MET08DDUPSFS6420.cs @@ -0,0 +1,183 @@ +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_43_4; + +[TestClass] +public class MET08DDUPSFS6420 : EAFLoggingUnitTesting +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + internal static string DummyRoot { get; private set; } + internal static MET08DDUPSFS6420 EAFLoggingUnitTesting { get; private set; } + + static MET08DDUPSFS6420() => DummyRoot = @"\\messv02ecc1.ec.local\EC_Characterization_Si\Dummy"; + + public MET08DDUPSFS6420() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) + { + if (EAFLoggingUnitTesting is null) + throw new Exception(); + } + + public MET08DDUPSFS6420(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + { + } + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + if (EAFLoggingUnitTesting is null) + EAFLoggingUnitTesting = new MET08DDUPSFS6420(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() + { + if (EAFLoggingUnitTesting.Logger is not null) + EAFLoggingUnitTesting.Logger.LogInformation("Cleanup"); + if (EAFLoggingUnitTesting is not null) + EAFLoggingUnitTesting.Dispose(); + } + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__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")); + } + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__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")); + } + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__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")); + } + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__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")); + } + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__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")); + } + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__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")); + } + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__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")); + } + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__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")); + } + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__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")); + } + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__Dummy() + { + string check = "637400762024374000.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")); + } + +} \ No newline at end of file diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/TENCOR3-EQPT.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.4/TENCOR1.cs similarity index 70% rename from Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/TENCOR3-EQPT.cs rename to Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.4/TENCOR1.cs index 6e3234c..ba4ae3c 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/TENCOR3-EQPT.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.4/TENCOR1.cs @@ -6,24 +6,27 @@ using System.Diagnostics; using System.IO; using System.Reflection; -namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_43_0; +namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_43_4; [TestClass] -public class TENCOR3_EQPT : EAFLoggingUnitTesting +public class TENCOR1 : EAFLoggingUnitTesting { #pragma warning disable CA2254 #pragma warning disable IDE0060 - internal static TENCOR3_EQPT EAFLoggingUnitTesting { get; private set; } + internal static string DummyRoot { get; private set; } + internal static TENCOR1 EAFLoggingUnitTesting { get; private set; } - public TENCOR3_EQPT() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false) + static TENCOR1() => DummyRoot = @"\\messv02ecc1.ec.local\EC_Characterization_Si\Dummy"; + + public TENCOR1() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) { if (EAFLoggingUnitTesting is null) throw new Exception(); } - public TENCOR3_EQPT(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + public TENCOR1(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) { } @@ -31,7 +34,7 @@ public class TENCOR3_EQPT : EAFLoggingUnitTesting public static void ClassInitialize(TestContext testContext) { if (EAFLoggingUnitTesting is null) - EAFLoggingUnitTesting = new TENCOR3_EQPT(testContext); + EAFLoggingUnitTesting = new TENCOR1(testContext); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize")); string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName); File.WriteAllText(fileNameAndText[0], fileNameAndText[1]); @@ -47,10 +50,13 @@ public class TENCOR3_EQPT : EAFLoggingUnitTesting EAFLoggingUnitTesting.Dispose(); } +#if true + [Ignore] +#endif [TestMethod] - public void Staging__v2_43_0__TENCOR3_EQPT__DownloadRsMFile() + public void Staging__v2_43_4__TENCOR1__pcl() { - string check = "WafrMeas.log|.RsM"; + string check = "*.pcl"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); _ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/TENCOR2.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.4/TENCOR2.cs similarity index 60% rename from Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/TENCOR2.cs rename to Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.4/TENCOR2.cs index c8acb30..24bef18 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/TENCOR2.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.4/TENCOR2.cs @@ -4,8 +4,9 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Diagnostics; using System.IO; +using System.Reflection; -namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_43_0; +namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_43_4; [TestClass] public class TENCOR2 : EAFLoggingUnitTesting @@ -14,15 +15,18 @@ public class TENCOR2 : EAFLoggingUnitTesting #pragma warning disable CA2254 #pragma warning disable IDE0060 + internal static string DummyRoot { get; private set; } internal static TENCOR2 EAFLoggingUnitTesting { get; private set; } - public TENCOR2() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false) + static TENCOR2() => DummyRoot = @"\\messv02ecc1.ec.local\EC_Characterization_Si\Dummy"; + + public TENCOR2() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) { if (EAFLoggingUnitTesting is null) throw new Exception(); } - public TENCOR2(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + public TENCOR2(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) { } @@ -46,9 +50,17 @@ public class TENCOR2 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Dispose(); } +#if true + [Ignore] +#endif [TestMethod] - public void Staging__v2_43_0__TENCOR2__() + public void Staging__v2_43_4__TENCOR2__pcl() { + string check = "*.pcl"; + 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.43.0/TENCOR3.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.4/TENCOR3.cs similarity index 77% rename from Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/TENCOR3.cs rename to Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.4/TENCOR3.cs index 16373e2..d38bc3d 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/TENCOR3.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.4/TENCOR3.cs @@ -6,7 +6,7 @@ using System.Diagnostics; using System.IO; using System.Reflection; -namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_43_0; +namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_43_4; [TestClass] public class TENCOR3 : EAFLoggingUnitTesting @@ -15,15 +15,18 @@ public class TENCOR3 : EAFLoggingUnitTesting #pragma warning disable CA2254 #pragma warning disable IDE0060 + internal static string DummyRoot { get; private set; } internal static TENCOR3 EAFLoggingUnitTesting { get; private set; } - public TENCOR3() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false) + static TENCOR3() => DummyRoot = @"\\messv02ecc1.ec.local\EC_Characterization_Si\Dummy"; + + public TENCOR3() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) { if (EAFLoggingUnitTesting is null) throw new Exception(); } - public TENCOR3(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + public TENCOR3(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) { } @@ -47,10 +50,13 @@ public class TENCOR3 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Dispose(); } +#if true + [Ignore] +#endif [TestMethod] - public void Staging__v2_43_0__TENCOR3__RsM() + public void Staging__v2_43_4__TENCOR3__pcl() { - string check = "*.RsM"; + string check = "*.pcl"; MethodBase methodBase = new StackFrame().GetMethod(); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); _ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); diff --git a/Adaptation/_Tests/Extract/Staging/v2.36.3/TENCOR1.cs b/Adaptation/_Tests/Extract/Staging/v2.36.3/TENCOR1.cs index 60065c8..103199e 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.36.3/TENCOR1.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.36.3/TENCOR1.cs @@ -22,9 +22,15 @@ public class TENCOR1 _TENCOR1 = CreateSelfDescription.Staging.v2_36_3.TENCOR1.EAFLoggingUnitTesting; } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_36_3__TENCOR1__MET08DDUPSFS6420() => _TENCOR1.Staging__v2_36_3__TENCOR1__MET08DDUPSFS6420(); +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_36_3__TENCOR1__MET08DDUPSFS6420637810124350899080__Normal() { diff --git a/Adaptation/_Tests/Extract/Staging/v2.39.0/MET08DDUPSFS6420.cs b/Adaptation/_Tests/Extract/Staging/v2.39.0/MET08DDUPSFS6420.cs index 05f8d5d..12044e2 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.39.0/MET08DDUPSFS6420.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.39.0/MET08DDUPSFS6420.cs @@ -22,9 +22,15 @@ public class MET08DDUPSFS6420 _MET08DDUPSFS6420 = CreateSelfDescription.Staging.v2_39_0.MET08DDUPSFS6420.EAFLoggingUnitTesting; } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420() => _MET08DDUPSFS6420.Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420(); +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420637710931421087642__Normal() { @@ -37,33 +43,63 @@ public class MET08DDUPSFS6420 _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics); } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420_() => _MET08DDUPSFS6420.Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420_(); +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420__() => _MET08DDUPSFS6420.Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420__(); +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420___() => _MET08DDUPSFS6420.Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420___(); +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420____() => _MET08DDUPSFS6420.Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420____(); +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420_____() => _MET08DDUPSFS6420.Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420_____(); +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420______() => _MET08DDUPSFS6420.Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420______(); +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420_______() => _MET08DDUPSFS6420.Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420_______(); +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420________() => _MET08DDUPSFS6420.Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420________(); +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420_________() => _MET08DDUPSFS6420.Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420_________(); +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420__________() => _MET08DDUPSFS6420.Staging__v2_39_0__MET08DDUPSFS6420__MET08DDUPSFS6420__________(); diff --git a/Adaptation/_Tests/Extract/Staging/v2.39.0/TENCOR1.cs b/Adaptation/_Tests/Extract/Staging/v2.39.0/TENCOR1.cs deleted file mode 100644 index e69de29..0000000 diff --git a/Adaptation/_Tests/Extract/Staging/v2.39.0/TENCOR2.cs b/Adaptation/_Tests/Extract/Staging/v2.39.0/TENCOR2.cs deleted file mode 100644 index e69de29..0000000 diff --git a/Adaptation/_Tests/Extract/Staging/v2.39.0/TENCOR3-EQPT.cs b/Adaptation/_Tests/Extract/Staging/v2.39.0/TENCOR3-EQPT.cs index c1e9180..959c450 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.39.0/TENCOR3-EQPT.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.39.0/TENCOR3-EQPT.cs @@ -18,6 +18,9 @@ public class TENCOR3_EQPT _TENCOR3_EQPT = CreateSelfDescription.Staging.v2_39_0.TENCOR3_EQPT.EAFLoggingUnitTesting; } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__TENCOR3_EQPT__DownloadRsMFile() => _TENCOR3_EQPT.Staging__v2_39_0__TENCOR3_EQPT__DownloadRsMFile(); diff --git a/Adaptation/_Tests/Extract/Staging/v2.39.0/TENCOR3.cs b/Adaptation/_Tests/Extract/Staging/v2.39.0/TENCOR3.cs index f0b2375..23466c8 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.39.0/TENCOR3.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.39.0/TENCOR3.cs @@ -18,6 +18,9 @@ public class TENCOR3 _TENCOR3 = CreateSelfDescription.Staging.v2_39_0.TENCOR3.EAFLoggingUnitTesting; } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_39_0__TENCOR3__RsM() => _TENCOR3.Staging__v2_39_0__TENCOR3__RsM(); diff --git a/Adaptation/_Tests/Extract/Staging/v2.43.0/MET08DDUPSFS6420.cs b/Adaptation/_Tests/Extract/Staging/v2.43.0/MET08DDUPSFS6420.cs index 95c75d9..9a3b153 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.43.0/MET08DDUPSFS6420.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.43.0/MET08DDUPSFS6420.cs @@ -1,4 +1,8 @@ +using Adaptation.Shared; +using Adaptation.Shared.Methods; using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics; +using System.Reflection; namespace Adaptation._Tests.Extract.Staging.v2_43_0; @@ -18,33 +22,78 @@ public class MET08DDUPSFS6420 _MET08DDUPSFS6420 = CreateSelfDescription.Staging.v2_43_0.MET08DDUPSFS6420.EAFLoggingUnitTesting; } +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_43_0__MET08DDUPSFS6420__MoveMatchingFiles() => _MET08DDUPSFS6420.Staging__v2_43_0__MET08DDUPSFS6420__MoveMatchingFiles(); +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_43_0__MET08DDUPSFS6420__OpenInsightMetrologyViewer() => _MET08DDUPSFS6420.Staging__v2_43_0__MET08DDUPSFS6420__OpenInsightMetrologyViewer(); +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_0__MET08DDUPSFS6420__OpenInsightMetrologyViewer637810124350899080__Normal() + { + string check = "~IsXToOpenInsightMetrologyViewer"; + MethodBase methodBase = new StackFrame().GetMethod(); + _MET08DDUPSFS6420.Staging__v2_43_0__MET08DDUPSFS6420__OpenInsightMetrologyViewer(); + string[] variables = _MET08DDUPSFS6420.AdaptationTesting.GetVariables(methodBase, check); + IFileRead fileRead = _MET08DDUPSFS6420.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); + Logistics logistics = new(fileRead); + _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics); + } + +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_43_0__MET08DDUPSFS6420__IQSSi() => _MET08DDUPSFS6420.Staging__v2_43_0__MET08DDUPSFS6420__IQSSi(); +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_43_0__MET08DDUPSFS6420__OpenInsight() => _MET08DDUPSFS6420.Staging__v2_43_0__MET08DDUPSFS6420__OpenInsight(); +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_43_0__MET08DDUPSFS6420__OpenInsightMetrologyViewerAttachments() => _MET08DDUPSFS6420.Staging__v2_43_0__MET08DDUPSFS6420__OpenInsightMetrologyViewerAttachments(); +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_43_0__MET08DDUPSFS6420__APC() => _MET08DDUPSFS6420.Staging__v2_43_0__MET08DDUPSFS6420__APC(); +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_43_0__MET08DDUPSFS6420__SPaCe() => _MET08DDUPSFS6420.Staging__v2_43_0__MET08DDUPSFS6420__SPaCe(); +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_43_0__MET08DDUPSFS6420__Processed() => _MET08DDUPSFS6420.Staging__v2_43_0__MET08DDUPSFS6420__Processed(); +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_43_0__MET08DDUPSFS6420__Archive() => _MET08DDUPSFS6420.Staging__v2_43_0__MET08DDUPSFS6420__Archive(); +#if true + [Ignore] +#endif [TestMethod] public void Staging__v2_43_0__MET08DDUPSFS6420__Dummy() => _MET08DDUPSFS6420.Staging__v2_43_0__MET08DDUPSFS6420__Dummy(); diff --git a/Adaptation/_Tests/Extract/Staging/v2.43.0/TENCOR1.cs b/Adaptation/_Tests/Extract/Staging/v2.43.0/TENCOR1.cs deleted file mode 100644 index e69de29..0000000 diff --git a/Adaptation/_Tests/Extract/Staging/v2.43.0/TENCOR2.cs b/Adaptation/_Tests/Extract/Staging/v2.43.0/TENCOR2.cs deleted file mode 100644 index e69de29..0000000 diff --git a/Adaptation/_Tests/Extract/Staging/v2.43.0/TENCOR3-EQPT.cs b/Adaptation/_Tests/Extract/Staging/v2.43.0/TENCOR3-EQPT.cs deleted file mode 100644 index 17fa8c1..0000000 --- a/Adaptation/_Tests/Extract/Staging/v2.43.0/TENCOR3-EQPT.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Adaptation._Tests.Extract.Staging.v2_43_0; - -[TestClass] -public class TENCOR3_EQPT -{ - -#pragma warning disable CA2254 -#pragma warning disable IDE0060 - - private static CreateSelfDescription.Staging.v2_43_0.TENCOR3_EQPT _TENCOR3_EQPT; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - CreateSelfDescription.Staging.v2_43_0.TENCOR3_EQPT.ClassInitialize(testContext); - _TENCOR3_EQPT = CreateSelfDescription.Staging.v2_43_0.TENCOR3_EQPT.EAFLoggingUnitTesting; - } - - [TestMethod] - public void Staging__v2_43_0__TENCOR3_EQPT__DownloadRsMFile() => _TENCOR3_EQPT.Staging__v2_43_0__TENCOR3_EQPT__DownloadRsMFile(); - -} \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.43.0/TENCOR3.cs b/Adaptation/_Tests/Extract/Staging/v2.43.0/TENCOR3.cs deleted file mode 100644 index 9bea224..0000000 --- a/Adaptation/_Tests/Extract/Staging/v2.43.0/TENCOR3.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Adaptation._Tests.Extract.Staging.v2_43_0; - -[TestClass] -public class TENCOR3 -{ - -#pragma warning disable CA2254 -#pragma warning disable IDE0060 - - private static CreateSelfDescription.Staging.v2_43_0.TENCOR3 _TENCOR3; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - CreateSelfDescription.Staging.v2_43_0.TENCOR3.ClassInitialize(testContext); - _TENCOR3 = CreateSelfDescription.Staging.v2_43_0.TENCOR3.EAFLoggingUnitTesting; - } - - [TestMethod] - public void Staging__v2_43_0__TENCOR3__RsM() => _TENCOR3.Staging__v2_43_0__TENCOR3__RsM(); - -} \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.43.4/MET08DDUPSFS6420.cs b/Adaptation/_Tests/Extract/Staging/v2.43.4/MET08DDUPSFS6420.cs new file mode 100644 index 0000000..eed1b99 --- /dev/null +++ b/Adaptation/_Tests/Extract/Staging/v2.43.4/MET08DDUPSFS6420.cs @@ -0,0 +1,100 @@ +using Adaptation.Shared; +using Adaptation.Shared.Methods; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics; +using System.Reflection; + +namespace Adaptation._Tests.Extract.Staging.v2_43_4; + +[TestClass] +public class MET08DDUPSFS6420 +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + private static CreateSelfDescription.Staging.v2_43_4.MET08DDUPSFS6420 _MET08DDUPSFS6420; + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + CreateSelfDescription.Staging.v2_43_4.MET08DDUPSFS6420.ClassInitialize(testContext); + _MET08DDUPSFS6420 = CreateSelfDescription.Staging.v2_43_4.MET08DDUPSFS6420.EAFLoggingUnitTesting; + } + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__MoveMatchingFiles() => _MET08DDUPSFS6420.Staging__v2_43_4__MET08DDUPSFS6420__MoveMatchingFiles(); + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__OpenInsightMetrologyViewer() => _MET08DDUPSFS6420.Staging__v2_43_4__MET08DDUPSFS6420__OpenInsightMetrologyViewer(); + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__OpenInsightMetrologyViewer637810124350899080__Normal() + { + string check = "~IsXToOpenInsightMetrologyViewer"; + MethodBase methodBase = new StackFrame().GetMethod(); + _MET08DDUPSFS6420.Staging__v2_43_4__MET08DDUPSFS6420__OpenInsightMetrologyViewer(); + string[] variables = _MET08DDUPSFS6420.AdaptationTesting.GetVariables(methodBase, check); + IFileRead fileRead = _MET08DDUPSFS6420.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); + Logistics logistics = new(fileRead); + _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics); + } + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__IQSSi() => _MET08DDUPSFS6420.Staging__v2_43_4__MET08DDUPSFS6420__IQSSi(); + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__OpenInsight() => _MET08DDUPSFS6420.Staging__v2_43_4__MET08DDUPSFS6420__OpenInsight(); + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__OpenInsightMetrologyViewerAttachments() => _MET08DDUPSFS6420.Staging__v2_43_4__MET08DDUPSFS6420__OpenInsightMetrologyViewerAttachments(); + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__APC() => _MET08DDUPSFS6420.Staging__v2_43_4__MET08DDUPSFS6420__APC(); + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__SPaCe() => _MET08DDUPSFS6420.Staging__v2_43_4__MET08DDUPSFS6420__SPaCe(); + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__Processed() => _MET08DDUPSFS6420.Staging__v2_43_4__MET08DDUPSFS6420__Processed(); + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__Archive() => _MET08DDUPSFS6420.Staging__v2_43_4__MET08DDUPSFS6420__Archive(); + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__MET08DDUPSFS6420__Dummy() => _MET08DDUPSFS6420.Staging__v2_43_4__MET08DDUPSFS6420__Dummy(); + +} \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.43.4/TENCOR1.cs b/Adaptation/_Tests/Extract/Staging/v2.43.4/TENCOR1.cs new file mode 100644 index 0000000..d3d7564 --- /dev/null +++ b/Adaptation/_Tests/Extract/Staging/v2.43.4/TENCOR1.cs @@ -0,0 +1,46 @@ +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_43_4; + +[TestClass] +public class TENCOR1 +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + private static CreateSelfDescription.Staging.v2_43_4.TENCOR1 _TENCOR1; + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + CreateSelfDescription.Staging.v2_43_4.TENCOR1.ClassInitialize(testContext); + _TENCOR1 = CreateSelfDescription.Staging.v2_43_4.TENCOR1.EAFLoggingUnitTesting; + } + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__TENCOR1__pcl() => _TENCOR1.Staging__v2_43_4__TENCOR1__pcl(); + + [TestMethod] + [ExpectedException(typeof(MissingMethodException))] + public void Staging__v2_43_4__TENCOR1__pcl637955518212649513__Normal() + { + string check = "*.pcl"; + bool validatePDSF = false; + _TENCOR1.Staging__v2_43_4__TENCOR1__pcl(); + MethodBase methodBase = new StackFrame().GetMethod(); + string[] variables = _TENCOR1.AdaptationTesting.GetVariables(methodBase, check, validatePDSF); + IFileRead fileRead = _TENCOR1.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); + Logistics logistics = new(fileRead); + _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics, validatePDSF); + } + +} \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.43.4/TENCOR2.cs b/Adaptation/_Tests/Extract/Staging/v2.43.4/TENCOR2.cs new file mode 100644 index 0000000..e153389 --- /dev/null +++ b/Adaptation/_Tests/Extract/Staging/v2.43.4/TENCOR2.cs @@ -0,0 +1,46 @@ +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_43_4; + +[TestClass] +public class TENCOR2 +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + private static CreateSelfDescription.Staging.v2_43_4.TENCOR2 _TENCOR2; + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + CreateSelfDescription.Staging.v2_43_4.TENCOR2.ClassInitialize(testContext); + _TENCOR2 = CreateSelfDescription.Staging.v2_43_4.TENCOR2.EAFLoggingUnitTesting; + } + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__TENCOR2__pcl() => _TENCOR2.Staging__v2_43_4__TENCOR2__pcl(); + + [TestMethod] + [ExpectedException(typeof(MissingMethodException))] + public void Staging__v2_43_4__TENCOR2__pcl637955534973701250__Normal() + { + string check = "*.pcl"; + bool validatePDSF = false; + _TENCOR2.Staging__v2_43_4__TENCOR2__pcl(); + MethodBase methodBase = new StackFrame().GetMethod(); + string[] variables = _TENCOR2.AdaptationTesting.GetVariables(methodBase, check, validatePDSF); + IFileRead fileRead = _TENCOR2.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); + Logistics logistics = new(fileRead); + _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics, validatePDSF); + } + +} \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.43.4/TENCOR3.cs b/Adaptation/_Tests/Extract/Staging/v2.43.4/TENCOR3.cs new file mode 100644 index 0000000..cc39a5e --- /dev/null +++ b/Adaptation/_Tests/Extract/Staging/v2.43.4/TENCOR3.cs @@ -0,0 +1,46 @@ +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_43_4; + +[TestClass] +public class TENCOR3 +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + private static CreateSelfDescription.Staging.v2_43_4.TENCOR3 _TENCOR3; + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + CreateSelfDescription.Staging.v2_43_4.TENCOR3.ClassInitialize(testContext); + _TENCOR3 = CreateSelfDescription.Staging.v2_43_4.TENCOR3.EAFLoggingUnitTesting; + } + +#if true + [Ignore] +#endif + [TestMethod] + public void Staging__v2_43_4__TENCOR3__pcl() => _TENCOR3.Staging__v2_43_4__TENCOR3__pcl(); + + [TestMethod] + [ExpectedException(typeof(MissingMethodException))] + public void Staging__v2_43_4__TENCOR3__pcl637955520360305921__Normal() + { + string check = "*.pcl"; + bool validatePDSF = false; + _TENCOR3.Staging__v2_43_4__TENCOR3__pcl(); + MethodBase methodBase = new StackFrame().GetMethod(); + string[] variables = _TENCOR3.AdaptationTesting.GetVariables(methodBase, check, validatePDSF); + IFileRead fileRead = _TENCOR3.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); + Logistics logistics = new(fileRead); + _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics, validatePDSF); + } + +} \ No newline at end of file diff --git a/Adaptation/_Tests/Shared/AdaptationTesting.cs b/Adaptation/_Tests/Shared/AdaptationTesting.cs index 997a93e..dc062a1 100644 --- a/Adaptation/_Tests/Shared/AdaptationTesting.cs +++ b/Adaptation/_Tests/Shared/AdaptationTesting.cs @@ -26,10 +26,13 @@ namespace Adaptation._Tests.Shared; public class AdaptationTesting : ISMTP { + protected readonly string _DummyRoot; protected readonly string _Environment; protected readonly string _HostNameAndPort; + protected readonly bool _HasWaitForProperty; protected readonly TestContext _TestContext; protected readonly bool _SkipEquipmentDictionary; + protected readonly string _TestContextPropertiesAsJson; protected readonly Dictionary _CellInstanceVersions; protected readonly Dictionary _EquipmentTypeVersions; protected readonly Dictionary _ParameterizedModelObjectDefinitionTypes; @@ -38,10 +41,13 @@ public class AdaptationTesting : ISMTP protected readonly Dictionary> _ModelObjectParameters; protected readonly Dictionary>> _EquipmentDictionaryEventDescriptions; + public string DummyRoot => _DummyRoot; public string Environment => _Environment; public TestContext TestContext => _TestContext; public string HostNameAndPort => _HostNameAndPort; + public bool HasWaitForProperty => _HasWaitForProperty; public bool SkipEquipmentDictionary => _SkipEquipmentDictionary; + public string TestContextPropertiesAsJson => _TestContextPropertiesAsJson; public Dictionary CellInstanceVersions => _CellInstanceVersions; public Dictionary EquipmentTypeVersions => _EquipmentTypeVersions; public Dictionary> ModelObjectParameters => _ModelObjectParameters; @@ -56,17 +62,22 @@ public class AdaptationTesting : ISMTP void ISMTP.SendNormalPriorityEmailMessage(string subject, string body) => throw new NotImplementedException(); - public AdaptationTesting(TestContext testContext, bool skipEquipmentDictionary) + public AdaptationTesting(string dummyRoot, TestContext testContext, bool skipEquipmentDictionary, string testContextPropertiesAsJson, bool hasWaitForProperty) { string environment = GetEnvironment(testContext); string hostNameAndPort = GetHostNameAndPort(environment); + _DummyRoot = dummyRoot; _TestContext = testContext; _Environment = environment; _HostNameAndPort = hostNameAndPort; + _HasWaitForProperty = hasWaitForProperty; _SkipEquipmentDictionary = skipEquipmentDictionary; + _TestContextPropertiesAsJson = testContextPropertiesAsJson; _CellInstanceVersions = new Dictionary(); _EquipmentTypeVersions = new Dictionary(); + _EquipmentTypeVersions = new Dictionary(); + _ParameterizedModelObjectDefinitionTypes = new Dictionary(); _ParameterizedModelObjectDefinitionTypes = new Dictionary(); _EquipmentDictionaryVersions = new Dictionary(); _FileConnectorConfigurations = new Dictionary(); @@ -94,23 +105,28 @@ public class AdaptationTesting : ISMTP return result; } - protected string GetTestResultsDirectory() + public static string GetTestResultsDirectory(string testContextTestResultsDirectory, bool hasWaitForProperty) { string result = string.Empty; string testResults = "05_TestResults"; - string checkDirectory = _TestContext.TestResultsDirectory; - if (string.IsNullOrEmpty(checkDirectory) || !checkDirectory.Contains(testResults)) - throw new Exception(); - string rootDirectory = Path.GetPathRoot(checkDirectory); - for (int i = 0; i < int.MaxValue; i++) + string checkDirectory = testContextTestResultsDirectory; + if (hasWaitForProperty && (string.IsNullOrEmpty(checkDirectory) || !checkDirectory.Contains(testResults))) + throw new Exception($"A:{checkDirectory}; B:{testResults};"); + else if (!hasWaitForProperty && (string.IsNullOrEmpty(checkDirectory) || !checkDirectory.Contains(testResults))) + result = testContextTestResultsDirectory; + else { - checkDirectory = Path.GetDirectoryName(checkDirectory); - if (string.IsNullOrEmpty(checkDirectory) || checkDirectory == rootDirectory) - break; - if (checkDirectory.EndsWith(testResults) && Directory.Exists(checkDirectory)) + string rootDirectory = Path.GetPathRoot(checkDirectory); + for (int i = 0; i < int.MaxValue; i++) { - result = checkDirectory; - break; + checkDirectory = Path.GetDirectoryName(checkDirectory); + if (string.IsNullOrEmpty(checkDirectory) || checkDirectory == rootDirectory) + break; + if (checkDirectory.EndsWith(testResults) && Directory.Exists(checkDirectory)) + { + result = checkDirectory; + break; + } } } if (string.IsNullOrEmpty(result)) @@ -118,6 +134,12 @@ public class AdaptationTesting : ISMTP return result; } + private string GetTestResultsDirectory(bool hasWaitForProperty) + { + string result = GetTestResultsDirectory(_TestContext.TestResultsDirectory, hasWaitForProperty); + return result; + } + protected static string GetCellInstanceConnectionName(string cellInstanceConnectionName) { string result; @@ -170,28 +192,29 @@ public class AdaptationTesting : ISMTP return results; } - internal string[] GetSegments(string methodBaseName) + public static MethodBaseName GetMethodBaseName(string dummyRoot, string environment, bool hasWaitForProperty, string methodBaseName, string testResultsDirectory) { - List results; - string fileFullName; + MethodBaseName result; string comment; - string[] textFiles; + string fileFullName; + string dummyDirectory; + string withActualCICN; string separator = "__"; + string textFileDirectory; string connectionNameAndTicks; string cellInstanceConnectionName; string ticks = DateTime.Now.Ticks.ToString(); string cellInstanceConnectionNameFromMethodBaseName; - string testResultsDirectory = GetTestResultsDirectory(); string[] segments = methodBaseName.Split(new string[] { separator }, StringSplitOptions.None); - if (segments[0] != _Environment) + if (segments[0] != environment) throw new Exception(); string rawVersionName = segments[1]; string rawCellInstanceName = segments[2]; string cellInstanceVersionName = segments[1].Replace('_', '.'); string cellInstanceName = segments[2].Replace('_', '-').Replace("_EQPT", "-EQPT"); - string before = string.Concat(_Environment, separator, rawVersionName, separator, cellInstanceName, separator); + string before = string.Concat(environment, separator, rawVersionName, separator, cellInstanceName, separator); string after = methodBaseName.Substring(before.Length); - string versionDirectory = Path.Combine(testResultsDirectory, _Environment, cellInstanceName, cellInstanceVersionName); + string versionDirectory = Path.Combine(testResultsDirectory, environment, cellInstanceName, cellInstanceVersionName); if (!Directory.Exists(versionDirectory)) _ = Directory.CreateDirectory(versionDirectory); comment = segments[segments.Length - 1]; @@ -221,87 +244,76 @@ public class AdaptationTesting : ISMTP cellInstanceConnectionNameFromMethodBaseName = after; } cellInstanceConnectionName = GetCellInstanceConnectionName(cellInstanceConnectionNameFromMethodBaseName); - string methodBaseNameWithActualCICN = GetMethodBaseNameWithActualCICN(methodBaseName, rawCellInstanceName, cellInstanceConnectionNameFromMethodBaseName, cellInstanceConnectionName, ticks); + withActualCICN = GetMethodBaseNameWithActualCICN(methodBaseName, rawCellInstanceName, cellInstanceConnectionNameFromMethodBaseName, cellInstanceConnectionName, ticks); + if (hasWaitForProperty) + dummyDirectory = string.Empty; + else if (string.IsNullOrEmpty(ticks)) + dummyDirectory = string.Empty; + else + { + if (string.IsNullOrEmpty(dummyRoot)) + throw new Exception($"{nameof(dummyRoot)} is empty!"); + if (!withActualCICN.Contains(ticks)) + throw new Exception($"{withActualCICN} doesn't contain {ticks}!"); + segments = withActualCICN.Split(new string[] { ticks }, StringSplitOptions.None); + dummyDirectory = Path.Combine(dummyRoot, cellInstanceName, ticks, string.Join(null, segments)); + if (!Directory.Exists(dummyDirectory)) + _ = Directory.CreateDirectory(dummyDirectory); + } if (string.IsNullOrEmpty(ticks)) { - textFiles = Array.Empty(); - fileFullName = Path.Combine(versionDirectory, methodBaseNameWithActualCICN, $"{cellInstanceConnectionNameFromMethodBaseName}.json"); + textFileDirectory = string.Empty; + fileFullName = Path.Combine(versionDirectory, withActualCICN, $"{cellInstanceConnectionNameFromMethodBaseName}.json"); } else { - segments = methodBaseNameWithActualCICN.Split(new string[] { ticks }, StringSplitOptions.None); - string textDirectory = Path.Combine(versionDirectory, segments[0], string.Concat(ticks, segments[1])); + segments = withActualCICN.Split(new string[] { ticks }, StringSplitOptions.None); + textFileDirectory = Path.Combine(versionDirectory, segments[0], string.Concat(ticks, segments[1])); fileFullName = Path.Combine(versionDirectory, segments[0], $"{cellInstanceConnectionNameFromMethodBaseName}.json"); - if (!Directory.Exists(textDirectory)) + } + result = new(after, before, cellInstanceConnectionName, cellInstanceConnectionNameFromMethodBaseName, cellInstanceName, cellInstanceVersionName, comment, dummyDirectory, fileFullName, rawCellInstanceName, rawVersionName, separator, testResultsDirectory, textFileDirectory, ticks, versionDirectory, withActualCICN); + return result; + } + + private MethodBaseName GetMethodBaseName(MethodBase methodBase) + { + MethodBaseName result; + string testResultsDirectory = GetTestResultsDirectory(_HasWaitForProperty); + result = GetMethodBaseName(_DummyRoot, _Environment, _HasWaitForProperty, methodBase.Name, testResultsDirectory); + return result; + } + + private string[] GetTextFiles(MethodBaseName mbn) + { + string[] results; + if (string.IsNullOrEmpty(mbn.TextFileDirectory)) + results = Array.Empty(); + else if (!Directory.Exists(mbn.TextFileDirectory)) + { + results = Array.Empty(); + if (!_HasWaitForProperty) + _ = Directory.CreateDirectory(mbn.TextFileDirectory); + else { - textFiles = Array.Empty(); - string renameDirectory = Path.Combine(Path.GetDirectoryName(textDirectory), $"_Rename - {Path.GetFileName(textDirectory)}"); + string renameDirectory = Path.Combine(Path.GetDirectoryName(mbn.TextFileDirectory), $"_Rename - {Path.GetFileName(mbn.TextFileDirectory)}"); _ = Directory.CreateDirectory(renameDirectory); _ = Process.Start("explorer.exe", renameDirectory); File.WriteAllText(Path.Combine(renameDirectory, $"{nameof(FileConnectorConfiguration.SourceFileFilter)}.txt"), string.Empty); File.WriteAllText(Path.Combine(renameDirectory, $"{nameof(FileConnectorConfiguration.SourceFileLocation)}.txt"), string.Empty); } - else + } + else + { + results = Directory.GetFiles(mbn.TextFileDirectory, "*.txt", SearchOption.TopDirectoryOnly); + if (!string.IsNullOrEmpty(mbn.Ticks) && _HasWaitForProperty && !results.Any()) { - textFiles = Directory.GetFiles(textDirectory, "*.txt", SearchOption.TopDirectoryOnly); - if (!textFiles.Any()) - { - _ = Process.Start("explorer.exe", textDirectory); - File.WriteAllText(Path.Combine(textDirectory, "_ Why.why"), string.Empty); - } + _ = Process.Start("explorer.exe", mbn.TextFileDirectory); + File.WriteAllText(Path.Combine(mbn.TextFileDirectory, "_ Why.why"), string.Empty); } } - results = new List - { - _Environment, - rawCellInstanceName, - cellInstanceName, - cellInstanceVersionName, - cellInstanceConnectionNameFromMethodBaseName, - cellInstanceConnectionName, - ticks, - comment, - fileFullName - }; - results.AddRange(textFiles); - return results.ToArray(); - } - - internal string[] GetSegments(MethodBase methodBase) - { - string[] results = GetSegments(methodBase.Name); return results; } - internal static string GetEnvironment(string[] segments) => segments[0]; - - internal static string GetRawCellInstanceName(string[] segments) => segments[1]; - - internal static string GetCellInstanceName(string[] segments) => segments[2]; - - internal static string GetCellInstanceVersionName(string[] segments) => segments[3]; - - internal static string GetCellInstanceConnectionNameFromMethodBaseName(string[] segments) => segments[4]; - - internal static string GetCellInstanceConnectionName(string[] segments) => segments[5]; - - internal static string GetTicks(string[] segments) => segments[6]; - - internal static string GetComment(string[] segments) => segments[7]; - - internal static FileInfo GetFileName(string[] segments) => new(segments[8]); - - internal static string[] GetTextFiles(string[] segments) - { - List results = new(); - if (segments.Length > 8) - { - for (int i = 9; i < segments.Length; i++) - results.Add(segments[i]); - } - return results.ToArray(); - } - protected static Stream ToStream(string @this) { MemoryStream memoryStream = new(); @@ -466,6 +478,7 @@ public class AdaptationTesting : ISMTP AppendLine("#pragma warning disable CA2254"). AppendLine("#pragma warning disable IDE0060"). AppendLine(). + AppendLine("internal static string DummyRoot { get; private set; }"). Append("internal static ").Append(cellInstanceNameWithoutHyphen).AppendLine(" EAFLoggingUnitTesting { get; private set; }"); else throw new Exception(); @@ -474,13 +487,15 @@ public class AdaptationTesting : ISMTP else if (i == 1) _ = stringBuilder. AppendLine(). - Append("public ").Append(cellInstanceNameWithoutHyphen).AppendLine("() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)"). + Append("static ").Append(cellInstanceNameWithoutHyphen).AppendLine("() => DummyRoot = @\"\\\\messv02ecc1.ec.local\\EC_Characterization_Si\\Dummy\";"). + AppendLine(). + Append("public ").Append(cellInstanceNameWithoutHyphen).AppendLine("() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)"). AppendLine("{"). AppendLine("if (EAFLoggingUnitTesting is null)"). AppendLine("throw new Exception();"). AppendLine("}"). AppendLine(). - Append("public ").Append(cellInstanceNameWithoutHyphen).AppendLine("(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)"). + Append("public ").Append(cellInstanceNameWithoutHyphen).AppendLine("(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)"). AppendLine("{"). AppendLine("}"). AppendLine(); @@ -541,6 +556,9 @@ public class AdaptationTesting : ISMTP if (i == 2) { _ = stringBuilder. + AppendLine("#if true"). + AppendLine("[Ignore]"). + AppendLine("#endif"). AppendLine("[TestMethod]"). Append("public void ").Append(methodName).Append("() => ").Append('_').Append(cellInstanceNameWithoutHyphen).Append('.').Append(methodName).AppendLine("();").AppendLine(); } @@ -550,13 +568,16 @@ public class AdaptationTesting : ISMTP throw new Exception("Versions should match!"); equipmentTypeName = componentsCellComponentCellComponent.Equipment.EquipmentType.Name; _ = stringBuilder. + AppendLine("#if true"). + AppendLine("[Ignore]"). + AppendLine("#endif"). AppendLine("[TestMethod]"). Append("public void ").Append(methodName).AppendLine("()"). AppendLine("{"). Append("string check = \"").Append(check.Split('\\').Last()).AppendLine("\";"). AppendLine("MethodBase methodBase = new StackFrame().GetMethod();"). AppendLine("EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, \" - Getting configuration\"));"). - AppendLine("_ = Shared.AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting);"). + AppendLine("_ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting);"). AppendLine("EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, \" - Exit\"));"). AppendLine("}"). AppendLine(); @@ -879,32 +900,26 @@ public class AdaptationTesting : ISMTP public string[] GetCSharpText(string testName) { string[] results; - string[] segments = GetSegments(testName); - FileInfo fileInfo = GetFileName(segments); - string cellInstanceName = GetCellInstanceName(segments); - string cellInstanceVersionName = GetCellInstanceVersionName(segments); - string cellInstanceConnectionName = GetCellInstanceConnectionName(segments); - if (!string.IsNullOrEmpty(cellInstanceConnectionName) && !Directory.Exists(fileInfo.DirectoryName)) + string testResultsDirectory = GetTestResultsDirectory(_HasWaitForProperty); + MethodBaseName mbn = GetMethodBaseName(_DummyRoot, _Environment, _HasWaitForProperty, testName, testResultsDirectory); + FileInfo fileInfo = new(mbn.FileFullName); + if (!string.IsNullOrEmpty(mbn.CellInstanceConnectionName) && !Directory.Exists(fileInfo.DirectoryName)) _ = Directory.CreateDirectory(fileInfo.Directory.FullName); - Tuple cellInstanceVersionTuple = GetCellInstanceVersionTuple(cellInstanceName, cellInstanceVersionName); - results = GetCSharpTextB(fileInfo, cellInstanceName, cellInstanceVersionName, cellInstanceVersionTuple.Item2); + Tuple cellInstanceVersionTuple = GetCellInstanceVersionTuple(mbn.CellInstanceName, mbn.CellInstanceVersionName); + results = GetCSharpTextB(fileInfo, mbn.CellInstanceName, mbn.CellInstanceVersionName, cellInstanceVersionTuple.Item2); return results; } public string[] GetConfiguration(MethodBase methodBase) { string[] results; - string[] segments = GetSegments(methodBase.Name); - string ticks = GetTicks(segments); - FileInfo fileInfo = GetFileName(segments); - string cellInstanceName = GetCellInstanceName(segments); - string cellInstanceVersionName = GetCellInstanceVersionName(segments); - string cellInstanceConnectionName = GetCellInstanceConnectionName(segments); - if (!string.IsNullOrEmpty(cellInstanceConnectionName) && !Directory.Exists(fileInfo.DirectoryName)) + MethodBaseName mbn = GetMethodBaseName(methodBase); + FileInfo fileInfo = new(mbn.FileFullName); + if (!string.IsNullOrEmpty(mbn.CellInstanceConnectionName) && !Directory.Exists(fileInfo.DirectoryName)) _ = Directory.CreateDirectory(fileInfo.Directory.FullName); - Tuple cellInstanceVersionTuple = GetCellInstanceVersionTuple(cellInstanceName, cellInstanceVersionName); - Tuple fileConnectorConfigurationTuple = GetFileConnectorConfigurationTuple(cellInstanceVersionTuple, cellInstanceConnectionName); - if (string.IsNullOrEmpty(ticks) && fileConnectorConfigurationTuple.Item2?.FileScanningIntervalInSeconds is not null) + Tuple cellInstanceVersionTuple = GetCellInstanceVersionTuple(mbn.CellInstanceName, mbn.CellInstanceVersionName); + Tuple fileConnectorConfigurationTuple = GetFileConnectorConfigurationTuple(cellInstanceVersionTuple, mbn.CellInstanceConnectionName); + if (string.IsNullOrEmpty(mbn.Ticks) && fileConnectorConfigurationTuple.Item2?.FileScanningIntervalInSeconds is not null) { string fileScanningIntervalInSecondsLine; string versionDirectory = Path.GetDirectoryName(fileInfo.DirectoryName); @@ -914,12 +929,12 @@ public class AdaptationTesting : ISMTP fileScanningIntervalInSecondsLine = $"+\t{fileConnectorConfigurationTuple.Item2.FileScanningIntervalInSeconds.Value:+0000}\t{Path.GetFileName(fileInfo.DirectoryName)}"; File.AppendAllLines(Path.Combine(versionDirectory, "FileScanningIntervalInSeconds.txt"), new string[] { fileScanningIntervalInSecondsLine }); } - Tuple equipmentTypeVersionTuple = GetEquipmentTypeVersionTuple(cellInstanceVersionTuple.Item2, cellInstanceConnectionName); + Tuple equipmentTypeVersionTuple = GetEquipmentTypeVersionTuple(cellInstanceVersionTuple.Item2, mbn.CellInstanceConnectionName); Tuple parameterizedModelObjectDefinitionTypeTuple = GetParameterizedModelObjectDefinitionTypeTuple(equipmentTypeVersionTuple); Tuple> modelObjectParametersTuple = GetModelObjectParameters(equipmentTypeVersionTuple); - Tuple equipmentDictionaryVersionTuple = GetEquipmentDictionaryVersionTuple(cellInstanceVersionTuple.Item2, cellInstanceConnectionName, equipmentTypeVersionTuple.Item4); + Tuple equipmentDictionaryVersionTuple = GetEquipmentDictionaryVersionTuple(cellInstanceVersionTuple.Item2, mbn.CellInstanceConnectionName, equipmentTypeVersionTuple.Item4); Tuple>> equipmentDictionaryIsAlwaysEnabledEventsTuple = GetEquipmentDictionaryIsAlwaysEnabledEventsTuple(equipmentDictionaryVersionTuple); - Dictionary objects = GetKeyValuePairs(cellInstanceName, cellInstanceVersionName, cellInstanceConnectionName, fileConnectorConfigurationTuple.Item2, equipmentTypeVersionTuple.Item2, parameterizedModelObjectDefinitionTypeTuple.Item2, modelObjectParametersTuple.Item2, equipmentDictionaryVersionTuple.Item2, equipmentDictionaryIsAlwaysEnabledEventsTuple.Item2); + Dictionary objects = GetKeyValuePairs(mbn.CellInstanceName, mbn.CellInstanceVersionName, mbn.CellInstanceConnectionName, fileConnectorConfigurationTuple.Item2, equipmentTypeVersionTuple.Item2, parameterizedModelObjectDefinitionTypeTuple.Item2, modelObjectParametersTuple.Item2, equipmentDictionaryVersionTuple.Item2, equipmentDictionaryIsAlwaysEnabledEventsTuple.Item2); string json = JsonSerializer.Serialize(objects, new JsonSerializerOptions { WriteIndented = true }); results = new string[] { fileInfo.FullName, json }; return results; @@ -928,22 +943,19 @@ public class AdaptationTesting : ISMTP public IFileRead Get(MethodBase methodBase, string sourceFileLocation, string sourceFileFilter, bool useCyclicalForDescription) { IFileRead result; - string[] segments = GetSegments(methodBase.Name); - FileInfo fileInfo = GetFileName(segments); - string cellInstanceName = GetCellInstanceName(segments); - string cellInstanceVersionName = GetCellInstanceVersionName(segments); + MethodBaseName mbn = GetMethodBaseName(methodBase); + FileInfo fileInfo = new(mbn.FileFullName); Dictionary fileParameter = new(); - string cellInstanceConnectionName = GetCellInstanceConnectionName(segments); - if (!string.IsNullOrEmpty(cellInstanceConnectionName) && !Directory.Exists(fileInfo.DirectoryName)) + if (!string.IsNullOrEmpty(mbn.CellInstanceConnectionName) && !Directory.Exists(fileInfo.DirectoryName)) _ = Directory.CreateDirectory(fileInfo.Directory.FullName); Dictionary> dummyRuns = new(); Dictionary> staticRuns = new(); - Tuple cellInstanceVersionTuple = GetCellInstanceVersionTuple(cellInstanceName, cellInstanceVersionName); - Tuple fileConnectorConfigurationTuple = GetFileConnectorConfigurationTuple(cellInstanceVersionTuple, cellInstanceConnectionName); - Tuple equipmentTypeVersionTuple = GetEquipmentTypeVersionTuple(cellInstanceVersionTuple.Item2, cellInstanceConnectionName); + Tuple cellInstanceVersionTuple = GetCellInstanceVersionTuple(mbn.CellInstanceName, mbn.CellInstanceVersionName); + Tuple fileConnectorConfigurationTuple = GetFileConnectorConfigurationTuple(cellInstanceVersionTuple, mbn.CellInstanceConnectionName); + Tuple equipmentTypeVersionTuple = GetEquipmentTypeVersionTuple(cellInstanceVersionTuple.Item2, mbn.CellInstanceConnectionName); Tuple parameterizedModelObjectDefinitionTypeTuple = GetParameterizedModelObjectDefinitionTypeTuple(equipmentTypeVersionTuple); Tuple> modelObjectParametersTuple = GetModelObjectParameters(equipmentTypeVersionTuple); - Tuple equipmentDictionaryVersionTuple = GetEquipmentDictionaryVersionTuple(cellInstanceVersionTuple.Item2, cellInstanceConnectionName, equipmentTypeVersionTuple.Item4); + Tuple equipmentDictionaryVersionTuple = GetEquipmentDictionaryVersionTuple(cellInstanceVersionTuple.Item2, mbn.CellInstanceConnectionName, equipmentTypeVersionTuple.Item4); _ = GetEquipmentDictionaryIsAlwaysEnabledEventsTuple(equipmentDictionaryVersionTuple); if (!string.IsNullOrEmpty(sourceFileLocation) && sourceFileLocation != fileConnectorConfigurationTuple.Item2.SourceFileLocation) fileConnectorConfigurationTuple.Item2.SourceFileLocation = sourceFileLocation; @@ -975,33 +987,29 @@ public class AdaptationTesting : ISMTP _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder); } } - result = FileHandlers.CellInstanceConnectionName.Get(this, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfigurationTuple.Item2, equipmentTypeVersionTuple.Item2, parameterizedModelObjectDefinitionTypeTuple.Item2, modelObjectParametersTuple.Item2, equipmentDictionaryVersionTuple.Item2, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: false); + result = FileHandlers.CellInstanceConnectionName.Get(this, fileParameter, mbn.CellInstanceName, mbn.CellInstanceConnectionName, fileConnectorConfigurationTuple.Item2, equipmentTypeVersionTuple.Item2, parameterizedModelObjectDefinitionTypeTuple.Item2, modelObjectParametersTuple.Item2, equipmentDictionaryVersionTuple.Item2, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: false); return result; } - public string[] GetVariables(MethodBase methodBase, string check) + public string[] GetVariables(MethodBase methodBase, string check, bool validatePDSF = true) { string[] results; string[] lines; string ipdsfFile; - string textFileDirectory; + string[] segments; string fileNameWithoutExtension; string searchPattern = "*.ipdsf"; + string methodBaseNameWithActualCICN; string sourceFileFilter = string.Empty; string sourceFileLocation = string.Empty; - string[] segments = GetSegments(methodBase); - string ticks = GetTicks(segments); - FileInfo fileInfo = GetFileName(segments); - string[] textFiles = GetTextFiles(segments); - string cellInstanceName = GetCellInstanceName(segments); - string rawCellInstanceName = GetRawCellInstanceName(segments); - string cellInstanceConnectionName = GetCellInstanceConnectionName(segments); - string cellInstanceConnectionNameFromMethodBaseName = GetCellInstanceConnectionNameFromMethodBaseName(segments); - string methodBaseNameWithActualCICN = GetMethodBaseNameWithActualCICN(methodBase.Name, rawCellInstanceName, cellInstanceConnectionNameFromMethodBaseName, cellInstanceConnectionName, ticks); + MethodBaseName mbn = GetMethodBaseName(methodBase); + string[] textFiles = GetTextFiles(mbn); if (!textFiles.Any()) - textFileDirectory = string.Empty; - else - textFileDirectory = Path.GetDirectoryName(textFiles[0]); + { + if (_HasWaitForProperty) + throw new Exception("Set text file!"); + sourceFileLocation = mbn.DummyDirectory; + } foreach (string textFile in textFiles) { lines = File.ReadAllLines(textFile); @@ -1012,18 +1020,20 @@ public class AdaptationTesting : ISMTP sourceFileFilter = lines[0]; else if (fileNameWithoutExtension == nameof(FileConnectorConfiguration.SourceFileLocation)) { - segments = lines[0].Split(new string[] { ticks }, StringSplitOptions.None); + methodBaseNameWithActualCICN = GetMethodBaseNameWithActualCICN(methodBase.Name, mbn.RawCellInstanceName, mbn.CellInstanceConnectionNameFromMethodBaseName, mbn.CellInstanceConnectionName, mbn.Ticks); + segments = lines[0].Split(new string[] { mbn.Ticks }, StringSplitOptions.None); if (segments.Length > 2) throw new Exception("Ticks should only appear once in source file location!"); if (segments.Length != 2) throw new Exception("Ticks missing from source file location!"); - if (segments[1].Contains(ticks)) + if (segments[1].Contains(mbn.Ticks)) throw new Exception("From source file location path should not contain ticks!"); - if (!segments[1].EndsWith(methodBaseNameWithActualCICN.Replace(ticks, string.Empty))) + if (!segments[1].EndsWith(methodBaseNameWithActualCICN.Replace(mbn.Ticks, string.Empty))) throw new Exception("Method name missing from source file location!"); sourceFileLocation = lines[0]; } } + FileInfo fileInfo = new(mbn.FileFullName); if (!Directory.Exists(fileInfo.Directory.FullName)) _ = Directory.CreateDirectory(fileInfo.Directory.FullName); if (!fileInfo.Exists) @@ -1044,25 +1054,30 @@ public class AdaptationTesting : ISMTP fileConnectorConfiguration.SourceFileFilter = sourceFileFilter; if (!string.IsNullOrEmpty(sourceFileLocation)) fileConnectorConfiguration.SourceFileLocation = sourceFileLocation; - if (string.IsNullOrEmpty(sourceFileLocation)) - ipdsfFile = searchPattern; + if (!validatePDSF) + ipdsfFile = string.Empty; else { - string ipdsfDirectory = Path.Combine(sourceFileLocation, "ipdsf"); - if (!Directory.Exists(ipdsfDirectory)) + if (string.IsNullOrEmpty(sourceFileLocation)) ipdsfFile = searchPattern; else { - string[] files = Directory.GetFiles(ipdsfDirectory, searchPattern, SearchOption.TopDirectoryOnly); - if (files.Any()) - ipdsfFile = files[0]; - else + string ipdsfDirectory = Path.Combine(sourceFileLocation, "ipdsf"); + if (!Directory.Exists(ipdsfDirectory)) ipdsfFile = searchPattern; + else + { + string[] files = Directory.GetFiles(ipdsfDirectory, searchPattern, SearchOption.TopDirectoryOnly); + if (files.Any()) + ipdsfFile = files[0]; + else + ipdsfFile = searchPattern; + } } + if (ipdsfFile == searchPattern) + throw new Exception(); } - if (ipdsfFile == searchPattern) - throw new Exception(); - results = new string[] { fileInfo.FullName, json, fileConnectorConfiguration.SourceFileLocation, fileConnectorConfiguration.SourceFileFilter, ipdsfFile, textFileDirectory }; + results = new string[] { fileInfo.FullName, json, fileConnectorConfiguration.SourceFileLocation, fileConnectorConfiguration.SourceFileFilter, ipdsfFile, mbn.TextFileDirectory }; if (string.IsNullOrEmpty(results[0])) throw new Exception(); if (string.IsNullOrEmpty(results[1])) @@ -1071,7 +1086,7 @@ public class AdaptationTesting : ISMTP throw new Exception(); if (string.IsNullOrEmpty(results[3])) throw new Exception(); - if (string.IsNullOrEmpty(results[4])) + if (validatePDSF && string.IsNullOrEmpty(results[4])) throw new Exception(); if (string.IsNullOrEmpty(results[5])) throw new Exception(); @@ -1232,29 +1247,32 @@ public class AdaptationTesting : ISMTP { 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); - if (!validatePDSF) - _ = GetLogisticsColumnsAndBody(fileRead, logistics, extractResult, new(string.Empty, Array.Empty(), Array.Empty())); - else + if (!fileRead.IsDuplicator) { - 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!"); + Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1)); + Assert.IsTrue(extractResult.Item3.Length > 0, "extractResult Array Length check!"); + Assert.IsNotNull(extractResult.Item4); + if (!validatePDSF) + _ = GetLogisticsColumnsAndBody(fileRead, logistics, extractResult, new(string.Empty, Array.Empty(), Array.Empty())); + else + { + 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]); } - UpdatePassDirectory(variables[2]); result = extractResult.Item1; return result; } } // namespace Adaptation._Tests.Helpers { public class AdaptationTesting { } } -// 2022-05-12 -> AdaptationTesting \ No newline at end of file +// 2022-08-05 -> AdaptationTesting \ No newline at end of file diff --git a/Adaptation/_Tests/Shared/EAFLoggingUnitTesting.cs b/Adaptation/_Tests/Shared/EAFLoggingUnitTesting.cs index 62a6cf7..bc6f20e 100644 --- a/Adaptation/_Tests/Shared/EAFLoggingUnitTesting.cs +++ b/Adaptation/_Tests/Shared/EAFLoggingUnitTesting.cs @@ -10,13 +10,13 @@ public class EAFLoggingUnitTesting : LoggingUnitTesting, IDisposable public AdaptationTesting AdaptationTesting => _AdaptationTesting; - public EAFLoggingUnitTesting(TestContext testContext, Type declaringType, bool skipEquipmentDictionary) : + public EAFLoggingUnitTesting(string dummyRoot, TestContext testContext, Type declaringType, bool skipEquipmentDictionary) : base(testContext, declaringType) { if (testContext is null || declaringType is null) _AdaptationTesting = null; else - _AdaptationTesting = new AdaptationTesting(testContext, skipEquipmentDictionary); + _AdaptationTesting = new AdaptationTesting(dummyRoot, testContext, skipEquipmentDictionary, _TestContextPropertiesAsJson, _HasWaitForProperty); } public new void Dispose() diff --git a/Adaptation/_Tests/Shared/MethodBaseName.cs b/Adaptation/_Tests/Shared/MethodBaseName.cs new file mode 100644 index 0000000..b14c1f5 --- /dev/null +++ b/Adaptation/_Tests/Shared/MethodBaseName.cs @@ -0,0 +1,45 @@ +namespace Adaptation._Tests.Shared; + +public class MethodBaseName +{ + + public string After { get; private set; } + public string Before { get; private set; } + public string CellInstanceConnectionName { get; private set; } + public string CellInstanceConnectionNameFromMethodBaseName { get; private set; } + public string CellInstanceName { get; private set; } + public string CellInstanceVersionName { get; private set; } + public string Comment { get; private set; } + public string DummyDirectory { get; private set; } + public string FileFullName { get; private set; } + public string RawCellInstanceName { get; private set; } + public string RawVersionName { get; private set; } + public string Separator { get; private set; } + public string TestResultsDirectory { get; private set; } + public string TextFileDirectory { get; private set; } + public string Ticks { get; private set; } + public string VersionDirectory { get; private set; } + public string WithActualCICN { get; private set; } + + public MethodBaseName(string after, string before, string cellInstanceConnectionName, string cellInstanceConnectionNameFromMethodBaseName, string cellInstanceName, string cellInstanceVersionName, string comment, string dummyDirectory, string fileFullName, string rawCellInstanceName, string rawVersionName, string separator, string testResultsDirectory, string textFileDirectory, string ticks, string versionDirectory, string withActualCICN) + { + After = after; + Before = before; + CellInstanceConnectionName = cellInstanceConnectionName; + CellInstanceConnectionNameFromMethodBaseName = cellInstanceConnectionNameFromMethodBaseName; + CellInstanceName = cellInstanceName; + CellInstanceVersionName = cellInstanceVersionName; + Comment = comment; + DummyDirectory = dummyDirectory; + FileFullName = fileFullName; + RawCellInstanceName = rawCellInstanceName; + RawVersionName = rawVersionName; + Separator = separator; + TestResultsDirectory = testResultsDirectory; + TextFileDirectory = textFileDirectory; + Ticks = ticks; + VersionDirectory = versionDirectory; + WithActualCICN = withActualCICN; + } + +} \ No newline at end of file diff --git a/Adaptation/_Tests/Shared/UnitTesting.cs b/Adaptation/_Tests/Shared/UnitTesting.cs index 3477030..28df790 100644 --- a/Adaptation/_Tests/Shared/UnitTesting.cs +++ b/Adaptation/_Tests/Shared/UnitTesting.cs @@ -13,9 +13,13 @@ namespace Adaptation._Tests.Shared; public class UnitTesting { + protected readonly bool _HasWaitForProperty; protected readonly IsEnvironment _IsEnvironment; + protected readonly string _TestContextPropertiesAsJson; public IsEnvironment IsEnvironment => _IsEnvironment; + public bool HasWaitForProperty => _HasWaitForProperty; + public string TestContextPropertiesAsJson => _TestContextPropertiesAsJson; public UnitTesting(TestContext testContext, Type declaringType) { @@ -23,18 +27,23 @@ public class UnitTesting _IsEnvironment = null; else { + string waitFor = "\"WaitFor\":"; string projectDirectory = GetProjectDirectory(testContext); - string json = JsonSerializer.Serialize(testContext.Properties); + _TestContextPropertiesAsJson = JsonSerializer.Serialize(testContext.Properties, new JsonSerializerOptions { WriteIndented = true }); + _HasWaitForProperty = _TestContextPropertiesAsJson.Contains(waitFor); string vsCodeDirectory = Path.Combine(projectDirectory, ".vscode"); if (!Directory.Exists(vsCodeDirectory)) _ = Directory.CreateDirectory(vsCodeDirectory); string launchText = GetLaunchText(); File.WriteAllText(Path.Combine(vsCodeDirectory, "launch.json"), launchText); - for (int i = 0; i < int.MaxValue; i++) + if (_HasWaitForProperty) { - if (!json.Contains("Debugger.IsAttached") || Debugger.IsAttached) - break; - Thread.Sleep(500); + for (int i = 0; i < int.MaxValue; i++) + { + if (!_TestContextPropertiesAsJson.Contains($"{waitFor} \"Debugger.IsAttached\"") || Debugger.IsAttached) + break; + Thread.Sleep(500); + } } MethodBase methodBase = declaringType.GetMethod(testContext.TestName); if (methodBase is not null) diff --git a/Adaptation/_Tests/Static/pcl.cs b/Adaptation/_Tests/Static/pcl.cs new file mode 100644 index 0000000..fab146e --- /dev/null +++ b/Adaptation/_Tests/Static/pcl.cs @@ -0,0 +1,67 @@ +using Adaptation._Tests.Shared; +using Microsoft.Extensions.Logging; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Diagnostics; +using System.Reflection; + +namespace Adaptation._Tests.Static; + +[TestClass] +public class PCL : LoggingUnitTesting, IDisposable +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + internal static PCL LoggingUnitTesting { get; private set; } + + public PCL() : base(testContext: null, declaringType: null) + { + if (LoggingUnitTesting is null) + throw new Exception(); + } + + public PCL(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType) + { + } + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + if (LoggingUnitTesting is null) + LoggingUnitTesting = new PCL(testContext); + } + + [ClassCleanup()] + public static void ClassCleanup() + { + if (LoggingUnitTesting.Logger is not null) + LoggingUnitTesting.Logger.LogInformation("Cleanup"); + if (LoggingUnitTesting is not null) + LoggingUnitTesting.Dispose(); + } + + [TestMethod] + public void TestDescriptor() + { + FileHandlers.pcl.Descriptor descriptor; + MethodBase methodBase = new StackFrame().GetMethod(); + LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); + descriptor = FileHandlers.pcl.ProcessData.GetDescriptor("12-123456-1234"); + Assert.IsTrue(descriptor.Reactor is "12"); + Assert.IsTrue(descriptor.RDS is "123456"); + Assert.IsTrue(descriptor.PSN is "1234"); + descriptor = FileHandlers.pcl.ProcessData.GetDescriptor("123456"); + Assert.IsTrue(descriptor.Reactor is "00"); + Assert.IsTrue(descriptor.RDS is "123456"); + Assert.IsTrue(descriptor.PSN is "0000"); + descriptor = FileHandlers.pcl.ProcessData.GetDescriptor("MP"); + Assert.IsTrue(descriptor.Reactor is "00"); + Assert.IsTrue(descriptor.RDS is "000000"); + Assert.IsTrue(descriptor.PSN is "0000"); + Assert.IsTrue(descriptor.Employee is "MP"); + LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + } + +} \ No newline at end of file diff --git a/Adaptation/package.json b/Adaptation/package.json index 366bc59..6c3a831 100644 --- a/Adaptation/package.json +++ b/Adaptation/package.json @@ -1,5 +1,21 @@ { "scripts": { + "AA-CreateSelfDescription.Staging.v2_43_4-TENCOR1_EQPT": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.CreateSelfDescription.Staging.v2_43_4 & ClassName~TENCOR1_EQPT\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", + "AB-CreateSelfDescription.Staging.v2_43_4-TENCOR2_EQPT": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.CreateSelfDescription.Staging.v2_43_4 & ClassName~TENCOR2_EQPT\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", + "AC-CreateSelfDescription.Staging.v2_43_4-TENCOR3_EQPT": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.CreateSelfDescription.Staging.v2_43_4 & ClassName~TENCOR3_EQPT\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", + "BA-CreateSelfDescription.Staging.v2_43_4-TENCOR1": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.CreateSelfDescription.Staging.v2_43_4 & ClassName~TENCOR1\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", + "BB-CreateSelfDescription.Staging.v2_43_4-TENCOR2": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.CreateSelfDescription.Staging.v2_43_4 & ClassName~TENCOR2\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", + "BC-CreateSelfDescription.Staging.v2_43_4-TENCOR3": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.CreateSelfDescription.Staging.v2_43_4 & ClassName~TENCOR3\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", + "CA-CreateSelfDescription.Staging.v2_43_4-MET08DDUPSFS6420": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.CreateSelfDescription.Staging.v2_43_4 & ClassName~MET08DDUPSFS6420\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", + "DA-CreateSelfDescription.Staging.v2_43_4": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.CreateSelfDescription.Staging.v2_43_4\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", + "EA-Extract.Staging.v2_43_4-TENCOR1_EQPT-Staging__v2_43_4__TENCOR1_EQPT__DownloadRsMFile637953072332628623__Normal": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_4 & ClassName~TENCOR1_EQPT & Name~Staging__v2_43_4__TENCOR1_EQPT__DownloadRsMFile637953072332628623__Normal\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", + "EB-Extract.Staging.v2_43_4-TENCOR2_EQPT-Staging__v2_43_4__TENCOR2_EQPT__DownloadRsMFile637953072332628623__Normal": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_4 & ClassName~TENCOR2_EQPT & Name~Staging__v2_43_4__TENCOR2_EQPT__DownloadRsMFile637953072332628623__Normal\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", + "EC-Extract.Staging.v2_43_4-TENCOR3_EQPT-Staging__v2_43_4__TENCOR3_EQPT__DownloadRsMFile637953072332628623__Normal": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_4 & ClassName~TENCOR3_EQPT & Name~Staging__v2_43_4__TENCOR3_EQPT__DownloadRsMFile637953072332628623__Normal\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", + "FA-Extract.Staging.v2_43_4-TENCOR1-Staging__v2_43_4__TENCOR1__pcl637955518212649513__Normal": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_4 & ClassName~TENCOR1 & Name~Staging__v2_43_4__TENCOR1__pcl637955518212649513__Normal\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", + "FB-Extract.Staging.v2_43_4-TENCOR2-Staging__v2_43_4__TENCOR2__pcl637955534973701250__Normal": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_4 & ClassName~TENCOR2 & Name~Staging__v2_43_4__TENCOR2__pcl637955534973701250__Normal\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", + "FC-Extract.Staging.v2_43_4-TENCOR3-Staging__v2_43_4__TENCOR3__pcl637955520360305921__Normal": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_4 & ClassName~TENCOR3 & Name~Staging__v2_43_4__TENCOR3__pcl637955520360305921__Normal\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", + "GA-Extract.Staging.v2_43_4-MET08DDUPSFS6420-Staging__v2_43_4__MET08DDUPSFS6420__OpenInsightMetrologyViewer637810124350899080__Normal": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_4 & ClassName~MET08DDUPSFS6420 & Name~Staging__v2_43_4__MET08DDUPSFS6420__OpenInsightMetrologyViewer637810124350899080__Normal\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", + "HA-Extract.Staging.v2_43_4-TENCOR1-Staging__v2_43_4__TENCOR1__pcl637812984345592512__MinFileLength": "dotnet test --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_4 & ClassName~TENCOR1 & Name~Staging__v2_43_4__TENCOR1__pcl637812984345592512__MinFileLength\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", "Alpha": "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "nuget-clear": "dotnet nuget locals all --clear", "build": "dotnet build --runtime win-x64 --self-contained", @@ -9,24 +25,6 @@ "dotnet-format": "dotnet format --report .vscode --verbosity detailed --severity warn", "MSBuild": "\"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe\" /target:Build /restore:True /p:RestoreSources=https://api.nuget.org/v3/index.json%3Bhttps://packagemanagement.eu.infineon.com:4430/api/v2/%3Bhttps://tfs.intra.infineon.com/tfs/ManufacturingIT/_packaging/eaf/nuget/v3/index.json /detailedsummary /consoleloggerparameters:PerformanceSummary;ErrorsOnly; /property:Configuration=Debug;TargetFrameworkVersion=v4.8 ../MET08DDUPSFS6420.csproj", "pull": "git pull", - "garbage-collect": "git gc", - "AA-CreateSelfDescription.Staging.v2_43_0-TENCOR3_EQPT-Staging__v2_43_0__TENCOR3_EQPT__DownloadRsMFile": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.CreateSelfDescription.Staging.v2_43_0 & ClassName~TENCOR3_EQPT & Name~Staging__v2_43_0__TENCOR3_EQPT__DownloadRsMFile\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")", - "AT-CreateSelfDescription.Staging.v2_43_0-MET08DDUPSFS6420": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.CreateSelfDescription.Staging.v2_43_0 & ClassName~MET08DDUPSFS6420\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")", - "AV-CreateSelfDescription.Staging.v2_43_0-TENCOR1_EQPT": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.CreateSelfDescription.Staging.v2_43_0 & ClassName~TENCOR1_EQPT\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")", - "AW-CreateSelfDescription.Staging.v2_43_0-TENCOR1": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.CreateSelfDescription.Staging.v2_43_0 & ClassName~TENCOR1\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")", - "AV-CreateSelfDescription.Staging.v2_43_0-TENCOR2_EQPT": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.CreateSelfDescription.Staging.v2_43_0 & ClassName~TENCOR2_EQPT\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")", - "AW-CreateSelfDescription.Staging.v2_43_0-TENCOR2": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.CreateSelfDescription.Staging.v2_43_0 & ClassName~TENCOR2\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")", - "AX-CreateSelfDescription.Staging.v2_43_0-TENCOR3_EQPT": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.CreateSelfDescription.Staging.v2_43_0 & ClassName~TENCOR3_EQPT\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")", - "AY-CreateSelfDescription.Staging.v2_43_0-TENCOR3": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.CreateSelfDescription.Staging.v2_43_0 & ClassName~TENCOR3\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")", - "AZ-CreateSelfDescription.Staging.v2_43_0": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.CreateSelfDescription.Staging.v2_43_0\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")", - "BA-Extract.Staging.v2_43_0-TENCOR1-Staging__v2_36_3__TENCOR1__MET08DDUPSFS6420": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_36_3 & ClassName~TENCOR1 & Name~Staging__v2_36_3__TENCOR1__MET08DDUPSFS6420637810124350899080__Normal\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")", - "BT-Extract.Staging.v2_43_0-MET08DDUPSFS6420": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_0 & ClassName~MET08DDUPSFS6420\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")", - "BV-Extract.Staging.v2_43_0-TENCOR1_EQPT": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_0 & ClassName~TENCOR1_EQPT\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")", - "BW-Extract.Staging.v2_43_0-TENCOR1": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_0 & ClassName~TENCOR1\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")", - "BV-Extract.Staging.v2_43_0-TENCOR2_EQPT": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_0 & ClassName~TENCOR2_EQPT\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")", - "BW-Extract.Staging.v2_43_0-TENCOR2": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_0 & ClassName~TENCOR2\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")", - "BX-Extract.Staging.v2_43_0-TENCOR3_EQPT": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_0 & ClassName~TENCOR3_EQPT\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")", - "BY-Extract.Staging.v2_43_0-TENCOR3": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_0 & ClassName~TENCOR3\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")", - "BZ-Extract.Staging.v2_43_0": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_0\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")" + "garbage-collect": "git gc" } } \ No newline at end of file diff --git a/MET08DDUPSFS6420.csproj b/MET08DDUPSFS6420.csproj index 5676e18..2c1fd1e 100644 --- a/MET08DDUPSFS6420.csproj +++ b/MET08DDUPSFS6420.csproj @@ -103,10 +103,17 @@ + + + + + + + @@ -165,6 +172,8 @@ 6.0.3 - + + + \ No newline at end of file