Removed more not needed properties from api
This commit is contained in:
parent
c5e3acc3e4
commit
ae47e7dbd5
@ -6,7 +6,6 @@ using System.Globalization;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Adaptation.FileHandlers.MoveAllFiles.ApiController;
|
namespace Adaptation.FileHandlers.MoveAllFiles.ApiController;
|
||||||
|
@ -23,28 +23,28 @@ public class QaMetTest
|
|||||||
public string RecipePattern { get; set; }
|
public string RecipePattern { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("min")]
|
[JsonPropertyName("min")]
|
||||||
public double Min { get; set; }
|
public object Min { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("max")]
|
[JsonPropertyName("max")]
|
||||||
public double Max { get; set; }
|
public object Max { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("phaseMin")]
|
[JsonPropertyName("phaseMin")]
|
||||||
public double? PhaseMin { get; set; }
|
public object PhaseMin { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("slots")]
|
[JsonPropertyName("slots")]
|
||||||
public object Slots { get; set; }
|
public object Slots { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("wfrQty")]
|
[JsonPropertyName("wfrQty")]
|
||||||
public int WfrQty { get; set; }
|
public int? WfrQty { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("reactSched")]
|
[JsonPropertyName("reactSched")]
|
||||||
public bool ReactSched { get; set; }
|
public bool? ReactSched { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("interval")]
|
[JsonPropertyName("interval")]
|
||||||
public int Interval { get; set; }
|
public int? Interval { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("start")]
|
[JsonPropertyName("start")]
|
||||||
public int Start { get; set; }
|
public int? Start { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("sequence")]
|
[JsonPropertyName("sequence")]
|
||||||
public string Sequence { get; set; }
|
public string Sequence { get; set; }
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Adaptation.FileHandlers.MoveAllFiles.OpenInsight;
|
namespace Adaptation.FileHandlers.MoveAllFiles.OpenInsight;
|
||||||
|
@ -47,7 +47,7 @@ public class API : LoggingUnitTesting, IDisposable
|
|||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (!true)
|
#if true
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -55,38 +55,68 @@ public class API : LoggingUnitTesting, IDisposable
|
|||||||
{
|
{
|
||||||
MethodBase methodBase = new StackFrame().GetMethod();
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
#nullable enable
|
#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();
|
HttpClient httpClient = new();
|
||||||
// string rds = "504162";
|
FileHandlers.MoveAllFiles.OpenInsight.Root? root;
|
||||||
string rds = "601132";
|
|
||||||
string url = $"{FileRead.OpenInsightApplicationProgrammingInterface}/materials/rds/{rds}";
|
|
||||||
string httpClientResult = httpClient.GetStringAsync(url).Result;
|
|
||||||
FileHandlers.MoveAllFiles.OpenInsight.Root? root = JsonSerializer.Deserialize<FileHandlers.MoveAllFiles.OpenInsight.Root>(httpClientResult);
|
|
||||||
httpClient.Dispose();
|
|
||||||
Assert.IsNotNull(root?.Rds.ProdSpec.PrsStages);
|
|
||||||
List<FileHandlers.MoveAllFiles.OpenInsight.QaMetTest>? collection;
|
List<FileHandlers.MoveAllFiles.OpenInsight.QaMetTest>? collection;
|
||||||
Dictionary<string, List<FileHandlers.MoveAllFiles.OpenInsight.QaMetTest>> qaMetTests = new();
|
Dictionary<string, List<FileHandlers.MoveAllFiles.OpenInsight.QaMetTest>> qaMetTests = new();
|
||||||
foreach (FileHandlers.MoveAllFiles.OpenInsight.PrsStage prsStage in root.Rds.ProdSpec.PrsStages)
|
foreach (int runDataSheet in runDataSheets)
|
||||||
{
|
{
|
||||||
if (prsStage.QaMetTests is null)
|
url = $"{FileRead.OpenInsightApplicationProgrammingInterface}/materials/rds/{runDataSheet}";
|
||||||
continue;
|
httpClientResult = httpClient.GetStringAsync(url).Result;
|
||||||
foreach (FileHandlers.MoveAllFiles.OpenInsight.QaMetTest qaMetTest in prsStage.QaMetTests)
|
try
|
||||||
|
{ root = JsonSerializer.Deserialize<FileHandlers.MoveAllFiles.OpenInsight.Root>(httpClientResult); }
|
||||||
|
catch (Exception)
|
||||||
{
|
{
|
||||||
if (qaMetTest.ToolClass != "FTIR")
|
root = null;
|
||||||
continue;
|
failures += 1;
|
||||||
if (!qaMetTests.TryGetValue(prsStage.Stage, out collection))
|
System.IO.File.WriteAllText($"D:/{runDataSheet}.json", httpClientResult);
|
||||||
{
|
|
||||||
qaMetTests.Add(prsStage.Stage, new());
|
|
||||||
if (!qaMetTests.TryGetValue(prsStage.Stage, out collection))
|
|
||||||
throw new Exception();
|
|
||||||
}
|
|
||||||
collection.Add(qaMetTest);
|
|
||||||
}
|
}
|
||||||
|
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);
|
httpClient.Dispose();
|
||||||
string json = JsonSerializer.Serialize(qaMetTests, new JsonSerializerOptions { WriteIndented = true });
|
json = JsonSerializer.Serialize(qaMetTests, new JsonSerializerOptions { WriteIndented = true });
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(json));
|
Assert.IsTrue(!string.IsNullOrEmpty(json));
|
||||||
System.IO.File.WriteAllText("D:/.json", json);
|
System.IO.File.WriteAllText("D:/.json", json);
|
||||||
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase?.Name, " - Exit"));
|
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase?.Name, " - Exit"));
|
||||||
|
Assert.IsTrue(failures == 0);
|
||||||
NonThrowTryCatch();
|
NonThrowTryCatch();
|
||||||
#nullable restore
|
#nullable restore
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user