HttpSelfHostConfigurationBaseAddress
OpenInsightApplicationProgrammingInterface Infineon.EAF.Runtime 2.49.3
This commit is contained in:
91
Adaptation/_Tests/Static/API.cs
Normal file
91
Adaptation/_Tests/Static/API.cs
Normal file
@ -0,0 +1,91 @@
|
||||
using Adaptation._Tests.Shared;
|
||||
using Adaptation.FileHandlers.MoveAllFiles;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Net.Http;
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Adaptation._Tests.Static;
|
||||
|
||||
[TestClass]
|
||||
public class API : LoggingUnitTesting, IDisposable
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static API LoggingUnitTesting { get; private set; }
|
||||
|
||||
public API() : base(testContext: null, declaringType: null)
|
||||
{
|
||||
if (LoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public API(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext) => LoggingUnitTesting ??= new API(testContext);
|
||||
|
||||
[ClassCleanup()]
|
||||
public static void ClassCleanup()
|
||||
{
|
||||
LoggingUnitTesting?.Logger?.LogInformation("Cleanup");
|
||||
LoggingUnitTesting?.Dispose();
|
||||
}
|
||||
|
||||
private static void NonThrowTryCatch()
|
||||
{
|
||||
try
|
||||
{ throw new Exception(); }
|
||||
catch (Exception) { }
|
||||
}
|
||||
|
||||
#if true
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void TestApiA()
|
||||
{
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
#nullable enable
|
||||
HttpClient httpClient = new();
|
||||
string httpClientResult = httpClient.GetStringAsync($"{FileRead.OpenInsightApplicationProgrammingInterface}/materials/rds/601132").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;
|
||||
Dictionary<string, List<FileHandlers.MoveAllFiles.OpenInsight.QaMetTest>> qaMetTests = new();
|
||||
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);
|
||||
string 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"));
|
||||
NonThrowTryCatch();
|
||||
#nullable restore
|
||||
}
|
||||
|
||||
}
|
@ -55,7 +55,7 @@ public class MET08DDUPSP1TBI : LoggingUnitTesting, IDisposable
|
||||
StringBuilder results = new();
|
||||
(string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[]
|
||||
{
|
||||
new("MET08DDUPSP1TBI", "v2.49.2"),
|
||||
new("MET08DDUPSP1TBI", "v2.49.3"),
|
||||
};
|
||||
string staging = "http://mestsa07ec.ec.local:9003/CellInstanceServiceV2";
|
||||
Shared.PasteSpecialXml.EAF.XML.API.CellInstance.CellInstanceVersion cellInstanceVersion;
|
||||
|
@ -208,7 +208,7 @@ public class TXT : LoggingUnitTesting, IDisposable
|
||||
StringBuilder results = new();
|
||||
(string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[]
|
||||
{
|
||||
new("SP101", "v2.49.2"),
|
||||
new("SP101", "v2.49.3"),
|
||||
new("SP101-EQPT", "v2.47.0"),
|
||||
};
|
||||
string staging = "http://mestsa07ec.ec.local:9003/CellInstanceServiceV2";
|
||||
|
Reference in New Issue
Block a user