From e7b721fdb3f8f6d73cdb97b02a355781650c5f02 Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Tue, 18 Jun 2024 10:55:12 -0700 Subject: [PATCH] awaiting-disposition-header-attachment-id --- .../ApiControllers/AwaitingDispoController.cs | 6 ++++ Server/OI.Metrology.Server.csproj | 8 ++--- Server/Repositories/InfinityQSV4Repository.cs | 4 ++- Server/Views/Shared/_Layout.cshtml | 30 ++++++++-------- Server/wwwroot/index.html | 32 ++++++++--------- Shared/Models/Cleans.cs | 2 +- Shared/Models/Inspection.cs | 2 +- Shared/Models/ProdSpec.cs | 2 +- Shared/Models/ProdSpecRoot.cs | 2 +- Shared/Models/PrsStage.cs | 2 +- Shared/Models/QaMetTest.cs | 2 +- .../Stateless/IAwaitingDispoController.cs | 1 + Shared/Models/Surfscan.cs | 2 +- Shared/Models/SurfscanRecipe.cs | 2 +- Static/AwaitingDispo/index.html | 32 ++++++++--------- Static/Export/index.html | 32 ++++++++--------- Static/Metrology/AwaitingDispo/index.html | 32 ++++++++--------- Static/Metrology/Export/index.html | 32 ++++++++--------- Static/Metrology/RunHeaders/index.html | 32 ++++++++--------- Static/Metrology/RunInfo/index.html | 32 ++++++++--------- Static/Metrology/index.html | 32 ++++++++--------- Static/RunHeaders/index.html | 32 ++++++++--------- Static/RunInfo/index.html | 32 ++++++++--------- Static/awaiting-disposition.html | 30 ++++++++-------- Static/export.html | 32 ++++++++--------- Static/index.html | 32 ++++++++--------- Static/js/index.js | 2 +- Static/js/site-server.js | 13 +++---- Static/run-headers.html | 34 +++++++++---------- Tests/UnitAwaitingDispoController.cs | 22 ++++++++++++ Tests/UnitTestClientSettingsController.cs | 2 ++ Tests/UnitTestExportController.cs | 2 +- Tests/UnitTestInfinityQSV3Controller.cs | 2 +- Tests/UnitTestInfinityQSV4Controller.cs | 26 ++++++++------ Tests/UnitTestToolTypesController.cs | 2 +- 35 files changed, 311 insertions(+), 273 deletions(-) diff --git a/Server/ApiControllers/AwaitingDispoController.cs b/Server/ApiControllers/AwaitingDispoController.cs index 711018b..b2cec4d 100644 --- a/Server/ApiControllers/AwaitingDispoController.cs +++ b/Server/ApiControllers/AwaitingDispoController.cs @@ -38,4 +38,10 @@ public class AwaitingDispoController : Controller, IAwaitingDispoController + Content(_MetrologyRepository.GetHeaderAttachmentID(toolTypeId, headerid).ToString()); + } \ No newline at end of file diff --git a/Server/OI.Metrology.Server.csproj b/Server/OI.Metrology.Server.csproj index 1d496b7..130ff7a 100644 --- a/Server/OI.Metrology.Server.csproj +++ b/Server/OI.Metrology.Server.csproj @@ -26,9 +26,9 @@ - + - + @@ -38,9 +38,9 @@ - + - + diff --git a/Server/Repositories/InfinityQSV4Repository.cs b/Server/Repositories/InfinityQSV4Repository.cs index 5fda686..c123135 100644 --- a/Server/Repositories/InfinityQSV4Repository.cs +++ b/Server/Repositories/InfinityQSV4Repository.cs @@ -169,6 +169,7 @@ public class InfinityQSV4Repository : IInfinityQSV4Repository private static StringBuilder GetForJsonPath(IDbConnectionFactory dbConnectionFactory, string commandText, bool useIqsConnection) { StringBuilder stringBuilder = new(); + File.WriteAllText("../../.sql", commandText); using DbConnection dbConnection = dbConnectionFactory.GetDbConnection(useIqsConnection); DbCommand dbCommand = dbConnection.CreateCommand(); dbCommand.CommandText = commandText; @@ -184,6 +185,7 @@ public class InfinityQSV4Repository : IInfinityQSV4Repository if (string.IsNullOrEmpty(infinityQSV4.Part)) throw new ArgumentException(nameof(infinityQSV4.Part)); string json = infinityQSV4Repository.GetProductionSpecification(infinityQSV4.Part); + File.WriteAllText("../../.json", json); ProdSpecRoot? prodSpec = JsonSerializer.Deserialize(json, ProdSpecRootSourceGenerationContext.Default.ProdSpecRoot); if (prodSpec is null) { @@ -415,7 +417,7 @@ public class InfinityQSV4Repository : IInfinityQSV4Repository results.Add(" join [spcepiworld].[dbo].[part_dat] pd "); results.Add(" on se.f_part = pd.f_part "); results.Add(" where se.f_flag = 0 "); - results.Add($" and pr.f_name in ({string.Join(',', eppReactorNumbers)} "); + results.Add($" and pr.f_name in ({string.Join(',', eppReactorNumbers)}) "); results.Add(" and pd.f_name = '1090 - Full Load' "); results.Add(" and se.f_test in (1104769646, 1312288843) "); results.Add(" group by se.f_test, "); diff --git a/Server/Views/Shared/_Layout.cshtml b/Server/Views/Shared/_Layout.cshtml index 061b927..bffc909 100644 --- a/Server/Views/Shared/_Layout.cshtml +++ b/Server/Views/Shared/_Layout.cshtml @@ -6,41 +6,41 @@ @ViewBag.Title - - - - - - - - @@ -99,9 +99,9 @@
- - @RenderSection("scripts", required: false) diff --git a/Server/wwwroot/index.html b/Server/wwwroot/index.html index 6c3658b..ad85167 100644 --- a/Server/wwwroot/index.html +++ b/Server/wwwroot/index.html @@ -6,41 +6,41 @@ Run Information - - - - - - - - @@ -172,11 +172,11 @@
- - - diff --git a/Shared/Models/Cleans.cs b/Shared/Models/Cleans.cs index 4a2fc40..8507aa2 100644 --- a/Shared/Models/Cleans.cs +++ b/Shared/Models/Cleans.cs @@ -8,7 +8,7 @@ public record Cleans( // [property: JsonPropertyName("cleanTools")] object[] cleanTools ); -[JsonSourceGenerationOptions(WriteIndented = true)] +[JsonSourceGenerationOptions(WriteIndented = true, NumberHandling = JsonNumberHandling.AllowReadingFromString)] [JsonSerializable(typeof(Cleans))] public partial class CleansSourceGenerationContext : JsonSerializerContext { diff --git a/Shared/Models/Inspection.cs b/Shared/Models/Inspection.cs index fd27b00..6ebcce3 100644 --- a/Shared/Models/Inspection.cs +++ b/Shared/Models/Inspection.cs @@ -11,7 +11,7 @@ public record Inspection( // [property: JsonPropertyName("backSide")] BackSide BackSide ); -[JsonSourceGenerationOptions(WriteIndented = true)] +[JsonSourceGenerationOptions(WriteIndented = true, NumberHandling = JsonNumberHandling.AllowReadingFromString)] [JsonSerializable(typeof(Inspection))] public partial class InspectionSourceGenerationContext : JsonSerializerContext { diff --git a/Shared/Models/ProdSpec.cs b/Shared/Models/ProdSpec.cs index 4615631..e19539d 100644 --- a/Shared/Models/ProdSpec.cs +++ b/Shared/Models/ProdSpec.cs @@ -19,7 +19,7 @@ public record ProdSpec( [property: JsonPropertyName("prsStages")] PrsStage[] PrsStages ); -[JsonSourceGenerationOptions(WriteIndented = true)] +[JsonSourceGenerationOptions(WriteIndented = true, NumberHandling = JsonNumberHandling.AllowReadingFromString)] [JsonSerializable(typeof(ProdSpec))] public partial class ProdSpecSourceGenerationContext : JsonSerializerContext { diff --git a/Shared/Models/ProdSpecRoot.cs b/Shared/Models/ProdSpecRoot.cs index df566fa..0c64275 100644 --- a/Shared/Models/ProdSpecRoot.cs +++ b/Shared/Models/ProdSpecRoot.cs @@ -8,7 +8,7 @@ public record ProdSpecRoot( // [property: JsonPropertyName("_class")] string Class ); -[JsonSourceGenerationOptions(WriteIndented = true)] +[JsonSourceGenerationOptions(WriteIndented = true, NumberHandling = JsonNumberHandling.AllowReadingFromString)] [JsonSerializable(typeof(ProdSpecRoot))] public partial class ProdSpecRootSourceGenerationContext : JsonSerializerContext { diff --git a/Shared/Models/PrsStage.cs b/Shared/Models/PrsStage.cs index c8b3f78..0f0e783 100644 --- a/Shared/Models/PrsStage.cs +++ b/Shared/Models/PrsStage.cs @@ -12,7 +12,7 @@ public record PrsStage( [property: JsonPropertyName("qaMetTests")] QaMetTest[] QaMetTests ); -[JsonSourceGenerationOptions(WriteIndented = true)] +[JsonSourceGenerationOptions(WriteIndented = true, NumberHandling = JsonNumberHandling.AllowReadingFromString)] [JsonSerializable(typeof(PrsStage))] public partial class PrsStageSourceGenerationContext : JsonSerializerContext { diff --git a/Shared/Models/QaMetTest.cs b/Shared/Models/QaMetTest.cs index cae855f..a0816a1 100644 --- a/Shared/Models/QaMetTest.cs +++ b/Shared/Models/QaMetTest.cs @@ -20,7 +20,7 @@ public record QaMetTest( [property: JsonPropertyName("sequence")] string Sequence ); -[JsonSourceGenerationOptions(WriteIndented = true)] +[JsonSourceGenerationOptions(WriteIndented = true, NumberHandling = JsonNumberHandling.AllowReadingFromString)] [JsonSerializable(typeof(QaMetTest))] public partial class QaMetTestSourceGenerationContext : JsonSerializerContext { diff --git a/Shared/Models/Stateless/IAwaitingDispoController.cs b/Shared/Models/Stateless/IAwaitingDispoController.cs index 93d19b9..ad6cf58 100644 --- a/Shared/Models/Stateless/IAwaitingDispoController.cs +++ b/Shared/Models/Stateless/IAwaitingDispoController.cs @@ -14,5 +14,6 @@ public interface IAwaitingDispoController T Index(); T MarkAsReviewed(long headerid, int tooltypeid); T MarkAsAwaiting(long headerid, int tooltypeid); + T GetHeaderAttachmentID(int toolTypeId, long headerid); } \ No newline at end of file diff --git a/Shared/Models/Surfscan.cs b/Shared/Models/Surfscan.cs index 3e490d5..69713a3 100644 --- a/Shared/Models/Surfscan.cs +++ b/Shared/Models/Surfscan.cs @@ -7,7 +7,7 @@ public record Surfscan( [property: JsonPropertyName("surfscanRecipes")] SurfscanRecipe[] SurfscanRecipes ); -[JsonSourceGenerationOptions(WriteIndented = true)] +[JsonSourceGenerationOptions(WriteIndented = true, NumberHandling = JsonNumberHandling.AllowReadingFromString)] [JsonSerializable(typeof(Surfscan))] public partial class SurfscanSourceGenerationContext : JsonSerializerContext { diff --git a/Shared/Models/SurfscanRecipe.cs b/Shared/Models/SurfscanRecipe.cs index 188484b..bd8c0f9 100644 --- a/Shared/Models/SurfscanRecipe.cs +++ b/Shared/Models/SurfscanRecipe.cs @@ -9,7 +9,7 @@ public record SurfscanRecipe( [property: JsonPropertyName("sampleSize")] int? SampleSize ); -[JsonSourceGenerationOptions(WriteIndented = true)] +[JsonSourceGenerationOptions(WriteIndented = true, NumberHandling = JsonNumberHandling.AllowReadingFromString)] [JsonSerializable(typeof(SurfscanRecipe))] public partial class SurfscanRecipeSourceGenerationContext : JsonSerializerContext { diff --git a/Static/AwaitingDispo/index.html b/Static/AwaitingDispo/index.html index d20de07..795bfc2 100644 --- a/Static/AwaitingDispo/index.html +++ b/Static/AwaitingDispo/index.html @@ -6,25 +6,25 @@ Run Information - + - - + - - - + + + - - - - - + + + + + - - + + @@ -150,9 +150,9 @@
- - - + + + \ No newline at end of file diff --git a/Static/Export/index.html b/Static/Export/index.html index d20de07..795bfc2 100644 --- a/Static/Export/index.html +++ b/Static/Export/index.html @@ -6,25 +6,25 @@ Run Information - + - - + - - - + + + - - - - - + + + + + - - + + @@ -150,9 +150,9 @@
- - - + + + \ No newline at end of file diff --git a/Static/Metrology/AwaitingDispo/index.html b/Static/Metrology/AwaitingDispo/index.html index d20de07..795bfc2 100644 --- a/Static/Metrology/AwaitingDispo/index.html +++ b/Static/Metrology/AwaitingDispo/index.html @@ -6,25 +6,25 @@ Run Information - + - - + - - - + + + - - - - - + + + + + - - + + @@ -150,9 +150,9 @@
- - - + + + \ No newline at end of file diff --git a/Static/Metrology/Export/index.html b/Static/Metrology/Export/index.html index d20de07..795bfc2 100644 --- a/Static/Metrology/Export/index.html +++ b/Static/Metrology/Export/index.html @@ -6,25 +6,25 @@ Run Information - + - - + - - - + + + - - - - - + + + + + - - + + @@ -150,9 +150,9 @@
- - - + + + \ No newline at end of file diff --git a/Static/Metrology/RunHeaders/index.html b/Static/Metrology/RunHeaders/index.html index d20de07..795bfc2 100644 --- a/Static/Metrology/RunHeaders/index.html +++ b/Static/Metrology/RunHeaders/index.html @@ -6,25 +6,25 @@ Run Information - + - - + - - - + + + - - - - - + + + + + - - + + @@ -150,9 +150,9 @@
- - - + + + \ No newline at end of file diff --git a/Static/Metrology/RunInfo/index.html b/Static/Metrology/RunInfo/index.html index d20de07..795bfc2 100644 --- a/Static/Metrology/RunInfo/index.html +++ b/Static/Metrology/RunInfo/index.html @@ -6,25 +6,25 @@ Run Information - + - - + - - - + + + - - - - - + + + + + - - + + @@ -150,9 +150,9 @@
- - - + + + \ No newline at end of file diff --git a/Static/Metrology/index.html b/Static/Metrology/index.html index d20de07..795bfc2 100644 --- a/Static/Metrology/index.html +++ b/Static/Metrology/index.html @@ -6,25 +6,25 @@ Run Information - + - - + - - - + + + - - - - - + + + + + - - + + @@ -150,9 +150,9 @@
- - - + + + \ No newline at end of file diff --git a/Static/RunHeaders/index.html b/Static/RunHeaders/index.html index d20de07..795bfc2 100644 --- a/Static/RunHeaders/index.html +++ b/Static/RunHeaders/index.html @@ -6,25 +6,25 @@ Run Information - + - - + - - - + + + - - - - - + + + + + - - + + @@ -150,9 +150,9 @@
- - - + + + \ No newline at end of file diff --git a/Static/RunInfo/index.html b/Static/RunInfo/index.html index d20de07..795bfc2 100644 --- a/Static/RunInfo/index.html +++ b/Static/RunInfo/index.html @@ -6,25 +6,25 @@ Run Information - + - - + - - - + + + - - - - - + + + + + - - + + @@ -150,9 +150,9 @@
- - - + + + \ No newline at end of file diff --git a/Static/awaiting-disposition.html b/Static/awaiting-disposition.html index 889e8e7..9ca3a81 100644 --- a/Static/awaiting-disposition.html +++ b/Static/awaiting-disposition.html @@ -6,24 +6,24 @@ Awaiting Disposition - + - - + - - + + - - - - - + + + + + - - + + @@ -77,9 +77,9 @@
- - - + + + \ No newline at end of file diff --git a/Static/export.html b/Static/export.html index 30b0efd..21fbb2a 100644 --- a/Static/export.html +++ b/Static/export.html @@ -6,25 +6,25 @@ Export Data - + - - + - - - + + + - - - - - + + + + + - - + + @@ -84,9 +84,9 @@
- - - + + + diff --git a/Static/index.html b/Static/index.html index d20de07..795bfc2 100644 --- a/Static/index.html +++ b/Static/index.html @@ -6,25 +6,25 @@ Run Information - + - - + - - - + + + - - - - - + + + + + - - + + @@ -150,9 +150,9 @@
- - - + + + \ No newline at end of file diff --git a/Static/js/index.js b/Static/js/index.js index 45e5ba9..16b5c58 100644 --- a/Static/js/index.js +++ b/Static/js/index.js @@ -1,10 +1,10 @@ $(document).ready(function () { - const initialHeaderAttachmentId = ""; const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); const initialHeaderId = urlParams.get('headerid'); const initialToolTypeID = urlParams.get('tooltypeid'); + const initialHeaderAttachmentId = urlParams.get('headerattachmentid'); initRunInfo("https://oi-metrology-viewer-prod.mes.infineon.com:4433/api", "https://oi-metrology-viewer-prod.mes.infineon.com", initialToolTypeID, initialHeaderId, initialHeaderAttachmentId); }); \ No newline at end of file diff --git a/Static/js/site-server.js b/Static/js/site-server.js index 061283d..9ef8ace 100644 --- a/Static/js/site-server.js +++ b/Static/js/site-server.js @@ -9,14 +9,15 @@ var _initialHeaderId = null; var _toolTypeMetaData = null; var _initialHeaderAttachmentId = null; -function loadRunInfoAwaitingDisposition() { +async function loadRunInfoAwaitingDisposition() { var row = $("#grid").igGrid("selectedRow"); if (row == null) return; var data = $("#grid").igGrid("findRecordByKey", row.id); if (data == null) return; - var targetURL = _StaticUrl + "/index.html?tooltypeid=" + data.ToolTypeID + "&headerid=" + data.ID; + var getResult = await $.get(_apiUrl + "/awaitingdispo/" + data.ToolTypeID + "/header-attachment-id?headerid=" + data.ID).promise(); + var targetURL = _StaticUrl + "/index.html?tooltypeid=" + data.ToolTypeID + "&headerid=" + data.ID + "&headerattachmentid=" + getResult; window.location.href = targetURL; } @@ -125,7 +126,7 @@ function loadRunInfoRunHeaders() { var data = $("#HeaderGrid").igGrid("findRecordByKey", row.id); if (data == null) return; - var targetURL = _StaticUrl + "/index.html?tooltypeid=" + data.ToolTypeID + "&headerid=" + data.ID; + var targetURL = _StaticUrl + "/index.html?tooltypeid=" + data.ToolTypeID + "&headerid=" + data.ID + "&headerattachmentid=" + data.headerAttachmentId; window.location.href = targetURL; } @@ -1070,7 +1071,7 @@ function initRunInfo(apiUrl, staticUrl, initialToolTypeID, initialHeaderId, init _apiUrl = apiUrl; _StaticUrl = staticUrl; _initialHeaderId = initialHeaderId === null ? "" : initialHeaderId; - _initialHeaderAttachmentId = initialHeaderAttachmentId === null ? "" : initialHeaderId; + _initialHeaderAttachmentId = initialHeaderAttachmentId === null ? "" : initialHeaderAttachmentId; $.getJSON(_apiUrl + '/tooltypes', function (data) { for (var i = 0; i < data.Results.length; i++) { if (data.Results[i].ToolTypeName === "CDE") { @@ -1177,7 +1178,7 @@ function postWorkMaterial() { _workMaterial['inCassetteNumber'] = data.InCassetteNumber; _workMaterial['outCassetteNumber'] = data.OutCassetteNumber; var mesage = "Data Saved for {" + _workMaterial['scan'] + "} RDS {" + data.RunDataSheet + "} slot {" + data.OutSlotNumber + "}"; - $.post(_apiUrl + "/api/Reactors/", _workMaterial, function (data) { + $.post(_apiUrl + "/Reactors/", _workMaterial, function (data) { DisplayWSMessage("info", mesage + " use [" + data + "]", null); }).fail(function () { ShowErrorMessage("Error"); @@ -1213,7 +1214,7 @@ function layer(layerNumber) { else { _workMaterial['scan'] = scan; _workMaterial['username'] = username; - $.getJSON(_apiUrl + "/api/WorkMaterial/" + scan + "/", function (data) { + $.getJSON(_apiUrl + "/WorkMaterial/" + scan + "/", function (data) { if (data.Results.length === 0) ShowErrorMessage("No data found"); else { diff --git a/Static/run-headers.html b/Static/run-headers.html index 0a91344..65d94c5 100644 --- a/Static/run-headers.html +++ b/Static/run-headers.html @@ -6,25 +6,25 @@ Run Headers - + - - + - - - + + + - - - - - + + + + + - - + + @@ -46,7 +46,7 @@
  • Awaiting Disposition
  • Run Information
  • Run Headers
  • -
  • Export
  • +
  • Export
  • Archive
  • - - - + + + \ No newline at end of file diff --git a/Tests/UnitAwaitingDispoController.cs b/Tests/UnitAwaitingDispoController.cs index 15dfcf3..117821f 100644 --- a/Tests/UnitAwaitingDispoController.cs +++ b/Tests/UnitAwaitingDispoController.cs @@ -107,4 +107,26 @@ public class UnitAwaitingDispoController _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); } + [TestMethod] + public void GetHeaderAttachmentID() + { + _Logger?.LogInformation("Starting Web Application"); + IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; + IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService(); + Guid? guid = metrologyRepository?.GetHeaderAttachmentID(toolTypeId: 1, headerId: 1); + Assert.IsNotNull(guid); + _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); + } + + [TestMethod] + public async Task GetHeaderAttachmentIDApi() + { + HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); + _Logger?.LogInformation("Starting Web Application"); + Assert.IsTrue(httpClient is not null); + HttpResponseMessage httpResponseMessage = await httpClient.GetAsync($"api/{_ControllerName}/1/header-attachment-id?headerid=1"); + Assert.IsNotNull(httpResponseMessage.Content); + _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); + } + } \ No newline at end of file diff --git a/Tests/UnitTestClientSettingsController.cs b/Tests/UnitTestClientSettingsController.cs index 69c3068..18b5483 100644 --- a/Tests/UnitTestClientSettingsController.cs +++ b/Tests/UnitTestClientSettingsController.cs @@ -50,6 +50,7 @@ public class UnitTestClientSettingsController _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); } +#pragma warning disable CS1998 [TestMethod] public async Task GetClientSettingsApi() { @@ -68,6 +69,7 @@ public class UnitTestClientSettingsController #endif _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); } +#pragma warning restore CS1998 [TestMethod] public void GetIpAddress() diff --git a/Tests/UnitTestExportController.cs b/Tests/UnitTestExportController.cs index a057995..2ccda27 100644 --- a/Tests/UnitTestExportController.cs +++ b/Tests/UnitTestExportController.cs @@ -247,7 +247,7 @@ public class UnitTestExportController _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); } - // [Ignore] + [Ignore] [TestMethod] public async Task GetCSVExportDat() { diff --git a/Tests/UnitTestInfinityQSV3Controller.cs b/Tests/UnitTestInfinityQSV3Controller.cs index b186894..67fd39b 100644 --- a/Tests/UnitTestInfinityQSV3Controller.cs +++ b/Tests/UnitTestInfinityQSV3Controller.cs @@ -205,7 +205,7 @@ public class UnitTestInfinityQSV3Controller HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); _Logger?.LogInformation("Starting Web Application"); Assert.IsTrue(httpClient is not null); - string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/epi-pro-temp-verification-collection/?night=44&night=46&night=52&night=54"); + string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/epi-pro-temp-verification-rows/?night=44&night=46&night=52&night=54"); File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetEpiProTempVerificationRows)}.json"), result); Assert.IsNotNull(result); _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); diff --git a/Tests/UnitTestInfinityQSV4Controller.cs b/Tests/UnitTestInfinityQSV4Controller.cs index 9460c22..de9a2d3 100644 --- a/Tests/UnitTestInfinityQSV4Controller.cs +++ b/Tests/UnitTestInfinityQSV4Controller.cs @@ -55,7 +55,7 @@ public class UnitTestInfinityQSV4Controller _Logger?.LogInformation("Starting Web Application"); IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; IInfinityQSV4Repository? infinityQSV4Repository = serviceProvider?.GetRequiredService(); - string? result = infinityQSV4Repository?.GetCommandText("1698497987", "61", "CDE5", "5012", "575908", ""); + string? result = infinityQSV4Repository?.GetCommandText("1718539249", "61", "CDE5", "5012", "575908", ""); Assert.IsNotNull(result); _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); NonThrowTryCatch(); @@ -67,7 +67,7 @@ public class UnitTestInfinityQSV4Controller HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); _Logger?.LogInformation("Starting Web Application"); Assert.IsTrue(httpClient is not null); - string? json = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/1698497987/commandText/?process=61&job=CDE5&part=5012&lot=575908&date_time=2023-02-24 15:15:00"); + string? json = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/1718539249/commandText/?process=61&job=CDE5&part=5012&lot=575908&date_time=2023-02-24 15:15:00"); File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetCommandText)}.sql"), json); Assert.IsNotNull(json); _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); @@ -80,7 +80,7 @@ public class UnitTestInfinityQSV4Controller _Logger?.LogInformation("Starting Web Application"); IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; IInfinityQSV4Repository? infinityQSV4Repository = serviceProvider?.GetRequiredService(); - Result? result = infinityQSV4Repository?.GetData("1698497987"); + Result? result = infinityQSV4Repository?.GetData("1718539249"); Assert.IsNotNull(result?.Results); Assert.IsTrue(result?.Results.Length != 0); Assert.IsNotNull(result?.Results[0].Process); @@ -98,8 +98,8 @@ public class UnitTestInfinityQSV4Controller HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); _Logger?.LogInformation("Starting Web Application"); Assert.IsTrue(httpClient is not null); - //string? json = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/1698497987 575908_2023-02-24 14-18-05.txt/data"); - string? json = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/1698497987/data"); + //string? json = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/1718539249 575908_2023-02-24 14-18-05.txt/data"); + string? json = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/1718539249/data"); File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetData)}.json"), json); Result? result = System.Text.Json.JsonSerializer.Deserialize>(json); Assert.IsNotNull(result?.Results); @@ -113,7 +113,7 @@ public class UnitTestInfinityQSV4Controller _Logger?.LogInformation("Starting Web Application"); IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; IInfinityQSV4Repository? infinityQSV4Repository = serviceProvider?.GetRequiredService(); - Result? result = infinityQSV4Repository?.GetDescriptors("1698497987"); + Result? result = infinityQSV4Repository?.GetDescriptors("1718539249"); Assert.IsNotNull(result?.Results); Assert.IsTrue(result?.Results.Length != 0); Assert.IsNotNull(result?.Results[0].SubGroupId); @@ -128,8 +128,8 @@ public class UnitTestInfinityQSV4Controller HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); _Logger?.LogInformation("Starting Web Application"); Assert.IsTrue(httpClient is not null); - //string? json = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/1698497987 575908_2023-02-24 14-18-05.txt/descriptors"); - string? json = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/1698497987/descriptors"); + //string? json = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/1718539249 575908_2023-02-24 14-18-05.txt/descriptors"); + string? json = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/1718539249/descriptors"); File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetDescriptors)}.json"), json); Result? result = System.Text.Json.JsonSerializer.Deserialize>(json); Assert.IsNotNull(result?.Results); @@ -143,7 +143,7 @@ public class UnitTestInfinityQSV4Controller _Logger?.LogInformation("Starting Web Application"); IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; IInfinityQSV4Repository? infinityQSV4Repository = serviceProvider?.GetRequiredService(); - Result? result = infinityQSV4Repository?.GetHeader("1698497987"); + Result? result = infinityQSV4Repository?.GetHeader("1718539249"); Assert.IsNotNull(result?.Results); Assert.IsNotNull(result?.Results[0].Part); _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); @@ -156,7 +156,7 @@ public class UnitTestInfinityQSV4Controller HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); _Logger?.LogInformation("Starting Web Application"); Assert.IsTrue(httpClient is not null); - string? json = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/1698497987/header"); + string? json = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/1718539249/header"); File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetHeader)}.json"), json); Result? result = System.Text.Json.JsonSerializer.Deserialize>(json); Assert.IsNotNull(result?.Results); @@ -209,7 +209,7 @@ public class UnitTestInfinityQSV4Controller HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); _Logger?.LogInformation("Starting Web Application"); Assert.IsTrue(httpClient is not null); - string? result = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/epi-pro-temp-verification-collection/?night=44&night=46&night=52&night=54"); + string? result = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/epi-pro-temp-verification-rows/?night=44&night=46&night=52&night=54"); File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetEpiProTempVerificationRows)}.json"), result); Assert.IsNotNull(result); _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); @@ -281,7 +281,11 @@ public class UnitTestInfinityQSV4Controller List? reactors = infinityQSV4Repository?.GetReactors(); Assert.IsNotNull(reactors); foreach (Reactor reactor in reactors) + { + if (reactor.LoadedRDS is null) + continue; rdsCollection.AddRange(reactor.LoadedRDS); + } List production = new(); foreach (int rds in rdsCollection) { diff --git a/Tests/UnitTestToolTypesController.cs b/Tests/UnitTestToolTypesController.cs index 1e07138..b82fec4 100644 --- a/Tests/UnitTestToolTypesController.cs +++ b/Tests/UnitTestToolTypesController.cs @@ -253,7 +253,7 @@ public class UnitTestToolTypesController _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); } - // [Ignore] + [Ignore] [TestMethod] public void OIExport() {