diff --git a/Adaptation/FileHandlers/MoveAllFiles/ApiController/BarcodeHelper.cs b/Adaptation/FileHandlers/MoveAllFiles/ApiController/BarcodeHelper.cs index fafe470..19d904d 100644 --- a/Adaptation/FileHandlers/MoveAllFiles/ApiController/BarcodeHelper.cs +++ b/Adaptation/FileHandlers/MoveAllFiles/ApiController/BarcodeHelper.cs @@ -6,7 +6,6 @@ using System.Globalization; using System.IO; using System.Net.Http; using System.Text.Json; -using System.Text.Json.Serialization; using System.Threading.Tasks; namespace Adaptation.FileHandlers.MoveAllFiles.ApiController; diff --git a/Adaptation/FileHandlers/MoveAllFiles/OpenInsight/QaMetTest.cs b/Adaptation/FileHandlers/MoveAllFiles/OpenInsight/QaMetTest.cs index cb36ca1..8652ec6 100644 --- a/Adaptation/FileHandlers/MoveAllFiles/OpenInsight/QaMetTest.cs +++ b/Adaptation/FileHandlers/MoveAllFiles/OpenInsight/QaMetTest.cs @@ -23,28 +23,28 @@ public class QaMetTest public string RecipePattern { get; set; } [JsonPropertyName("min")] - public double Min { get; set; } + public object Min { get; set; } [JsonPropertyName("max")] - public double Max { get; set; } + public object Max { get; set; } [JsonPropertyName("phaseMin")] - public double? PhaseMin { get; set; } + public object PhaseMin { get; set; } [JsonPropertyName("slots")] public object Slots { get; set; } [JsonPropertyName("wfrQty")] - public int WfrQty { get; set; } + public int? WfrQty { get; set; } [JsonPropertyName("reactSched")] - public bool ReactSched { get; set; } + public bool? ReactSched { get; set; } [JsonPropertyName("interval")] - public int Interval { get; set; } + public int? Interval { get; set; } [JsonPropertyName("start")] - public int Start { get; set; } + public int? Start { get; set; } [JsonPropertyName("sequence")] public string Sequence { get; set; } diff --git a/Adaptation/FileHandlers/MoveAllFiles/OpenInsight/Rds.cs b/Adaptation/FileHandlers/MoveAllFiles/OpenInsight/Rds.cs index ca0a491..0bd0390 100644 --- a/Adaptation/FileHandlers/MoveAllFiles/OpenInsight/Rds.cs +++ b/Adaptation/FileHandlers/MoveAllFiles/OpenInsight/Rds.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using System.Text.Json.Serialization; namespace Adaptation.FileHandlers.MoveAllFiles.OpenInsight; diff --git a/Adaptation/_Tests/Static/API.cs b/Adaptation/_Tests/Static/API.cs index 13f76ab..62268fa 100644 --- a/Adaptation/_Tests/Static/API.cs +++ b/Adaptation/_Tests/Static/API.cs @@ -47,7 +47,7 @@ public class API : LoggingUnitTesting, IDisposable catch (Exception) { } } -#if (!true) +#if true [Ignore] #endif [TestMethod] @@ -55,38 +55,68 @@ public class API : LoggingUnitTesting, IDisposable { MethodBase methodBase = new StackFrame().GetMethod(); #nullable enable + int[] runDataSheets = new int[] + { + 504162, + 601132, + 602591, + 602705, + 601247, + 602092, + 603002, + 602666, + 602804, + 602598, + 601939 + }; + string url; + string json; + int failures = 0; + string httpClientResult; HttpClient httpClient = new(); - // string rds = "504162"; - string rds = "601132"; - string url = $"{FileRead.OpenInsightApplicationProgrammingInterface}/materials/rds/{rds}"; - string httpClientResult = httpClient.GetStringAsync(url).Result; - FileHandlers.MoveAllFiles.OpenInsight.Root? root = JsonSerializer.Deserialize(httpClientResult); - httpClient.Dispose(); - Assert.IsNotNull(root?.Rds.ProdSpec.PrsStages); + FileHandlers.MoveAllFiles.OpenInsight.Root? root; List? collection; Dictionary> qaMetTests = new(); - foreach (FileHandlers.MoveAllFiles.OpenInsight.PrsStage prsStage in root.Rds.ProdSpec.PrsStages) + foreach (int runDataSheet in runDataSheets) { - if (prsStage.QaMetTests is null) - continue; - foreach (FileHandlers.MoveAllFiles.OpenInsight.QaMetTest qaMetTest in prsStage.QaMetTests) + url = $"{FileRead.OpenInsightApplicationProgrammingInterface}/materials/rds/{runDataSheet}"; + httpClientResult = httpClient.GetStringAsync(url).Result; + try + { root = JsonSerializer.Deserialize(httpClientResult); } + catch (Exception) { - if (qaMetTest.ToolClass != "FTIR") - continue; - if (!qaMetTests.TryGetValue(prsStage.Stage, out collection)) - { - qaMetTests.Add(prsStage.Stage, new()); - if (!qaMetTests.TryGetValue(prsStage.Stage, out collection)) - throw new Exception(); - } - collection.Add(qaMetTest); + root = null; + failures += 1; + System.IO.File.WriteAllText($"D:/{runDataSheet}.json", httpClientResult); } + if (root is null) + continue; + Assert.IsNotNull(root?.Rds.ProdSpec.PrsStages); + foreach (FileHandlers.MoveAllFiles.OpenInsight.PrsStage prsStage in root.Rds.ProdSpec.PrsStages) + { + if (prsStage.QaMetTests is null) + continue; + foreach (FileHandlers.MoveAllFiles.OpenInsight.QaMetTest qaMetTest in prsStage.QaMetTests) + { + if (qaMetTest.ToolClass != "FTIR") + continue; + if (!qaMetTests.TryGetValue(prsStage.Stage, out collection)) + { + qaMetTests.Add(prsStage.Stage, new()); + if (!qaMetTests.TryGetValue(prsStage.Stage, out collection)) + throw new Exception(); + } + collection.Add(qaMetTest); + } + } + Assert.IsTrue(qaMetTests.Count > 0); } - Assert.IsTrue(qaMetTests.Count > 0); - string json = JsonSerializer.Serialize(qaMetTests, new JsonSerializerOptions { WriteIndented = true }); + httpClient.Dispose(); + json = JsonSerializer.Serialize(qaMetTests, new JsonSerializerOptions { WriteIndented = true }); Assert.IsTrue(!string.IsNullOrEmpty(json)); System.IO.File.WriteAllText("D:/.json", json); LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase?.Name, " - Exit")); + Assert.IsTrue(failures == 0); NonThrowTryCatch(); #nullable restore }