Dynamic 5 and 14 point copy
AppSettings alignment with other projects _TestContextTestName over _TestContext
This commit is contained in:
parent
2afb312065
commit
6f52566fc2
@ -1039,19 +1039,19 @@ function recipeParametersButtonRunInfo() {
|
||||
$.getJSON('https://oi-prod-ec-api.mes.infineon.com:4433/api/oiWizard/materials/rds/' + jsonObject.RDS, function (data) {
|
||||
$("#RecipeParametersButton").prop("disabled", false);
|
||||
var text = "";
|
||||
var seperator = '\t';
|
||||
var separator = '\t';
|
||||
for (var i = 0; i < data.rds.rdsLayers.length; i++) {
|
||||
text = text
|
||||
+ data.rds.rdsLayers[i].EpiTime
|
||||
+ seperator + data.rds.rdsLayers[i].EpiH2Flow
|
||||
+ seperator + data.rds.rdsLayers[i].TCSFlow
|
||||
+ seperator + data.rds.rdsLayers[i].DiluentAdjParam
|
||||
+ seperator + data.rds.rdsLayers[i].EpiH2Flow
|
||||
+ seperator + data.rds.rdsLayers[i].DopantFlow
|
||||
+ seperator + data.rds.rdsLayers[i].FOffset
|
||||
+ seperator + data.rds.rdsLayers[i].SOffset
|
||||
+ seperator + data.rds.rdsLayers[i].ROffset
|
||||
+ seperator + data.rds.rdsLayers[i].SuscEtch;
|
||||
+ separator + data.rds.rdsLayers[i].EpiH2Flow
|
||||
+ separator + data.rds.rdsLayers[i].TCSFlow
|
||||
+ separator + data.rds.rdsLayers[i].DiluentAdjParam
|
||||
+ separator + data.rds.rdsLayers[i].EpiH2Flow
|
||||
+ separator + data.rds.rdsLayers[i].DopantFlow
|
||||
+ separator + data.rds.rdsLayers[i].FOffset
|
||||
+ separator + data.rds.rdsLayers[i].SOffset
|
||||
+ separator + data.rds.rdsLayers[i].ROffset
|
||||
+ separator + data.rds.rdsLayers[i].SuscEtch;
|
||||
}
|
||||
$("#textareaClipboard").val(text);
|
||||
$("#ModalBodyGrid").igGrid({
|
||||
@ -1112,14 +1112,14 @@ function viewButtonRunInfo() {
|
||||
$.getJSON(detailsURL, function (data) {
|
||||
var obj = {};
|
||||
var text = "";
|
||||
var seperator = jsonObject.RDS.length < 6 ? '\r' : '\t';
|
||||
for (var i = 0; i < data.Results.length && (jsonObject.RDS.length < 6 || i < 9); i++) {
|
||||
if (data.Results[i].Thickness) {
|
||||
text = text + data.Results[i].Thickness + seperator;
|
||||
var separator = jsonObject.RDS.length < 6 ? '\r' : '\t';
|
||||
for (var i = 0; i < data.Results.length; i++) {
|
||||
if (data.Results[i].Thickness && data.Results[i].Position && parseInt(data.Results[i].Position) > 0) {
|
||||
text = text + data.Results[i].Thickness + separator;
|
||||
obj['Point' + (i + 1)] = data.Results[i].Thickness;
|
||||
}
|
||||
else if (data.Results[i].Rs) {
|
||||
text = text + data.Results[i].Rs + seperator;
|
||||
else if (data.Results[i].Rs && data.Results[i].Position && parseInt(data.Results[i].Position) > 0) {
|
||||
text = text + data.Results[i].Rs + separator;
|
||||
obj['Point' + (i + 1)] = data.Results[i].Rs;
|
||||
}
|
||||
}
|
||||
@ -1191,18 +1191,18 @@ function pinButtonRunInfo() {
|
||||
responseDataKey: "Results",
|
||||
});
|
||||
var text = "";
|
||||
var seperator = '\t';
|
||||
var separator = '\t';
|
||||
for (var i = 0; i < data.Results.length; i++) {
|
||||
text = text
|
||||
+ data.Results[i].Point1
|
||||
+ seperator + data.Results[i].Point2
|
||||
+ seperator + data.Results[i].Point3
|
||||
+ seperator + data.Results[i].Point4
|
||||
+ seperator + data.Results[i].Point5
|
||||
+ seperator + data.Results[i].Point6
|
||||
+ seperator + data.Results[i].Point7
|
||||
+ seperator + data.Results[i].Point8
|
||||
+ seperator + data.Results[i].Point9;
|
||||
+ separator + data.Results[i].Point2
|
||||
+ separator + data.Results[i].Point3
|
||||
+ separator + data.Results[i].Point4
|
||||
+ separator + data.Results[i].Point5
|
||||
+ separator + data.Results[i].Point6
|
||||
+ separator + data.Results[i].Point7
|
||||
+ separator + data.Results[i].Point8
|
||||
+ separator + data.Results[i].Point9;
|
||||
}
|
||||
$("#textareaClipboard").val(text);
|
||||
$("#ModalBodyGrid").igGrid({
|
||||
|
11
Tests/.vscode/tc_col_metrology-viewer-dev.http
vendored
Normal file
11
Tests/.vscode/tc_col_metrology-viewer-dev.http
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
###
|
||||
POST http://localhost:5126/api/inbound/cde
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET http://localhost:5126/api/export/headers
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
POST http://localhost:5003/api/inbound/SRP
|
||||
Accept: application/json
|
5
Tests/.vscode/tc_col_metrology-viewer-v1.http
vendored
Normal file
5
Tests/.vscode/tc_col_metrology-viewer-v1.http
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
@host = https://oi-metrology-viewer-prod.mes.infineon.com:4432/api/v1
|
||||
|
||||
###
|
||||
GET {{host}}/WaferCounter/8INCH/last-quantity-and-slot-map/?area=MU
|
||||
Accept: application/json
|
21
Tests/.vscode/tc_col_metrology-viewer-v2.http
vendored
Normal file
21
Tests/.vscode/tc_col_metrology-viewer-v2.http
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
@host = https://oi-metrology-viewer-prod.mes.infineon.com/api/InfinityQSV2
|
||||
|
||||
###
|
||||
GET {{host}}/1677273357/header
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET {{host}}/1677273357/events
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET {{host}}/1677273357/descriptors
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET {{host}}/1677273357/data
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET {{host}}/1677273357/commandText/?process=61&job=CDE5&part=5012&lot=575908&date_time=2023-02-24 14:15:00
|
||||
Accept: application/json
|
17
Tests/.vscode/tc_col_metrology-viewer-v3.http
vendored
Normal file
17
Tests/.vscode/tc_col_metrology-viewer-v3.http
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
@host = https://oi-metrology-viewer-prod.mes.infineon.com/api/InfinityQSV3
|
||||
|
||||
###
|
||||
GET {{host}}/61/product-data-average-sum-of-defects-process-mean-process-sigma?recipe=8IN_IFX_ROTR
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET {{host}}/epi-pro-temp-verificatio
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET {{host}}/epi-pro-temp-verification-row
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET {{host}}/111/header
|
||||
Accept: application/json
|
32
Tests/.vscode/tc_col_metrology-viewer-v4.http
vendored
Normal file
32
Tests/.vscode/tc_col_metrology-viewer-v4.http
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
@host = http://metrology-viewer-prod.mes.infineon.com:5002/api/v4/InfinityQS
|
||||
@hostB = https://oi-metrology-viewer-prod.mes.infineon.com:4435/api/v4/InfinityQS
|
||||
@hostE = https://oi-metrology-viewer-prod.mes.infineon.com:4433/api/t1ooltypes
|
||||
@hostF = https://oi-metrology-viewer-prod.mes.infineon.com:4433/api/v4/InfinityQS
|
||||
|
||||
###
|
||||
GET {{host}}/reactors
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET {{host}}/4589/production-specification
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET {{host}}/engineering-spc-review
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET {{hostB}}/58/last-group-id-with-value/?part=4840&test=1228920625
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET {{hostE}}/-1/headertitles
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET {{hostF}}/epi-pro-temp-verification
|
||||
Accept: text/html
|
||||
|
||||
###
|
||||
GET {{hostF}}/epi-pro-temp-verification-rows
|
||||
Accept: application/json
|
51
Tests/.vscode/tc_col_metrology-viewer.http
vendored
Normal file
51
Tests/.vscode/tc_col_metrology-viewer.http
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
###
|
||||
GET https://oi-metrology-viewer-prod.mes.infineon.com/api/tooltypes
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET https://oi-metrology-viewer-prod.mes.infineon.com/api/export/export
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
POST http://oi-metrology-viewer-prod.mes.infineon.com/api/inbound/SRP
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET https://oi-metrology-viewer-prod.mes.infineon.com/api/export/pdsf
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET https://oi-metrology-viewer-prod.mes.infineon.com/api/export/logistics
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET https://oi-metrology-viewer-prod.mes.infineon.com/api/export/logistics
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET https://oi-metrology-viewer-prod.mes.infineon.com/api/export/headers
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET https://oi-metrology-viewer-prod.mes.infineon.com/api/InfinityQS/1677273357/header
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET https://oi-metrology-viewer-prod.mes.infineon.com/api/InfinityQS/1677273357/events
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET https://oi-metrology-viewer-prod.mes.infineon.com/api/InfinityQS/1677273357/descriptors
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET https://oi-metrology-viewer-prod.mes.infineon.com/api/InfinityQS/1677273357/data
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET https://oi-metrology-viewer-prod.mes.infineon.com/api/InfinityQS/commandText/?sub_group_id=1677273357&process=61&job=CDE5&part=5012&lot=575908&date_time=2023-02-24 14:15:00
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET https://oi-metrology-viewer-prod.mes.infineon.com:4436/api/AppSettings/App
|
||||
Accept: application/json
|
23
Tests/.vscode/wafer-counter.http
vendored
Normal file
23
Tests/.vscode/wafer-counter.http
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
|
||||
@host = https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/file-share/archive-data/?area=FQA&equipment-id=FQA-8INCH&search-pattern=*.wc&wafer-size=8INCH
|
||||
@hostB = https://oi-metrology-viewer-prod.mes.infineon.com:4437/api/v1
|
||||
@hostC = https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1
|
||||
@waferSize = 6INCH
|
||||
@area = FQA
|
||||
@cassID = Test
|
||||
|
||||
###
|
||||
GET {{host}}/archive-data/?area=FQA&equipment-id=FQA-8INCH&search-pattern=*.wc&wafer-size=8INCH
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET {{host}}/archive-data/?area=FQA&equipment-id=FQA-8INCH&search-pattern=*.wc&wafer-size=8INCH
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET {{hostC}}/WaferCounter/{{waferSize}}/last-quantity-and-slot-map/?area={{area}}&text={{cassID}}
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
GET {{hostB}}/file-share/equipment-ids
|
||||
Accept: application/json
|
@ -15,7 +15,7 @@ public class UnitAwaitingDispoController
|
||||
|
||||
private static ILogger? _Logger;
|
||||
private static string _ControllerName;
|
||||
private static TestContext _TestContext;
|
||||
private static string? _TestContextTestName;
|
||||
private static WebApplicationFactory<Server.Program>? _WebApplicationFactory;
|
||||
|
||||
#pragma warning restore
|
||||
@ -23,7 +23,7 @@ public class UnitAwaitingDispoController
|
||||
[ClassInitialize]
|
||||
public static void ClassInitAsync(TestContext testContext)
|
||||
{
|
||||
_TestContext = testContext;
|
||||
_TestContextTestName = testContext.TestName;
|
||||
_WebApplicationFactory = new WebApplicationFactory<Server.Program>();
|
||||
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
|
||||
_Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>();
|
||||
@ -35,7 +35,7 @@ public class UnitAwaitingDispoController
|
||||
{
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.AreEqual(IAwaitingDispoController<string>.GetRouteName(), _ControllerName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
@ -47,7 +47,7 @@ public class UnitAwaitingDispoController
|
||||
IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>();
|
||||
IEnumerable<AwaitingDisposition>? awaitingDispositions = metrologyRepository?.GetAwaitingDisposition();
|
||||
Assert.IsTrue(awaitingDispositions is not null);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
@ -59,7 +59,7 @@ public class UnitAwaitingDispoController
|
||||
Assert.IsTrue(httpClient is not null);
|
||||
string? json = await httpClient.GetStringAsync($"api/{_ControllerName}");
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(IMetrologyRepository.GetAwaitingDisposition)}Api.json"), json);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
@ -70,7 +70,7 @@ public class UnitAwaitingDispoController
|
||||
IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider;
|
||||
IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>();
|
||||
_ = metrologyRepository?.UpdateReviewDate(toolTypeId: 1, headerId: 1, clearDate: false);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
@ -81,7 +81,7 @@ public class UnitAwaitingDispoController
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.IsTrue(httpClient is not null);
|
||||
_ = await httpClient.GetFromJsonAsync<object>($"api/{_ControllerName}/markasreviewed");
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
@ -93,7 +93,7 @@ public class UnitAwaitingDispoController
|
||||
IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>();
|
||||
int? dateCleared = metrologyRepository?.UpdateReviewDate(toolTypeId: 1, headerId: 1, clearDate: true);
|
||||
Assert.IsTrue(dateCleared <= 1);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
@ -104,7 +104,7 @@ public class UnitAwaitingDispoController
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.IsTrue(httpClient is not null);
|
||||
_ = await httpClient.PostAsync($"api/{_ControllerName}/markasawaiting", null);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -115,7 +115,7 @@ public class UnitAwaitingDispoController
|
||||
IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>();
|
||||
Guid? guid = metrologyRepository?.GetHeaderAttachmentID(toolTypeId: 1, headerId: 1);
|
||||
Assert.IsNotNull(guid);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -126,7 +126,7 @@ public class UnitAwaitingDispoController
|
||||
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);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
}
|
@ -15,7 +15,7 @@ public class UnitInboundController
|
||||
|
||||
private static ILogger? _Logger;
|
||||
private static string _ControllerName;
|
||||
private static TestContext _TestContext;
|
||||
private static string? _TestContextTestName;
|
||||
private static WebApplicationFactory<Server.Program>? _WebApplicationFactory;
|
||||
|
||||
#pragma warning restore
|
||||
@ -23,7 +23,7 @@ public class UnitInboundController
|
||||
[ClassInitialize]
|
||||
public static void ClassInitAsync(TestContext testContext)
|
||||
{
|
||||
_TestContext = testContext;
|
||||
_TestContextTestName = testContext.TestName;
|
||||
_WebApplicationFactory = new WebApplicationFactory<Server.Program>();
|
||||
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
|
||||
_Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>();
|
||||
@ -42,7 +42,7 @@ public class UnitInboundController
|
||||
{
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.AreEqual(IInboundController<string>.GetRouteName(), _ControllerName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ public class UnitInboundController
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.IsTrue(httpClient is not null);
|
||||
_ = await httpClient.PostAsync($"api/{_ControllerName}/BioRad", GetStringContent());
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ public class UnitInboundController
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.IsTrue(httpClient is not null);
|
||||
_ = await httpClient.PostAsync($"api/{_ControllerName}/BioRad/attachment", GetStringContent());
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ public class UnitTestAppSettingsController
|
||||
|
||||
private static ILogger? _Logger;
|
||||
private static string _ControllerName;
|
||||
private static TestContext _TestContext;
|
||||
private static string? _TestContextTestName;
|
||||
private static WebApplicationFactory<Server.Program>? _WebApplicationFactory;
|
||||
|
||||
#pragma warning restore
|
||||
@ -23,7 +23,7 @@ public class UnitTestAppSettingsController
|
||||
[ClassInitialize]
|
||||
public static void ClassInitAsync(TestContext testContext)
|
||||
{
|
||||
_TestContext = testContext;
|
||||
_TestContextTestName = testContext.TestName;
|
||||
_WebApplicationFactory = new WebApplicationFactory<Server.Program>();
|
||||
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
|
||||
_Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>();
|
||||
@ -42,7 +42,7 @@ public class UnitTestAppSettingsController
|
||||
{
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.AreEqual(IAppSettingsController<object>.GetRouteName(), _ControllerName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ public class UnitTestAppSettingsController
|
||||
IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider;
|
||||
IAppSettingsRepository<Server.Models.Binder.AppSettings>? appSettingsRepository = serviceProvider?.GetRequiredService<IAppSettingsRepository<Server.Models.Binder.AppSettings>>();
|
||||
appSettingsRepository?.VerifyConnectionStrings();
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ public class UnitTestAppSettingsController
|
||||
IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider;
|
||||
AppSettings? appSettings = serviceProvider?.GetRequiredService<AppSettings>();
|
||||
Assert.IsNotNull(appSettings);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ public class UnitTestAppSettingsController
|
||||
IAppSettingsRepository<Server.Models.Binder.AppSettings>? appSettingsRepository = serviceProvider?.GetRequiredService<IAppSettingsRepository<Server.Models.Binder.AppSettings>>();
|
||||
Server.Models.Binder.AppSettings? appSettings = appSettingsRepository?.GetAppSettings();
|
||||
Assert.IsTrue(appSettings is not null);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ public class UnitTestAppSettingsController
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetAppSettings)}.json"), json);
|
||||
Assert.IsNotNull(json);
|
||||
Assert.IsTrue(json != "[]");
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ public class UnitTestAppSettingsController
|
||||
IAppSettingsRepository<Server.Models.Binder.AppSettings>? appSettingsRepository = serviceProvider?.GetRequiredService<IAppSettingsRepository<Server.Models.Binder.AppSettings>>();
|
||||
string? result = appSettingsRepository?.GetBuildNumberAndGitCommitSeven();
|
||||
Assert.IsTrue(result is not null);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ public class UnitTestAppSettingsController
|
||||
string json = await httpResponseMessage.Content.ReadAsStringAsync();
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetBuildNumberAndGitCommitSeven)}.json"), json);
|
||||
Assert.IsNotNull(json);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ public class UnitTestClientSettingsController
|
||||
|
||||
private static ILogger? _Logger;
|
||||
private static string _ControllerName;
|
||||
private static TestContext _TestContext;
|
||||
private static string? _TestContextTestName;
|
||||
private static WebApplicationFactory<Server.Program>? _WebApplicationFactory;
|
||||
|
||||
#pragma warning restore
|
||||
@ -22,7 +22,7 @@ public class UnitTestClientSettingsController
|
||||
[ClassInitialize]
|
||||
public static void ClassInitAsync(TestContext testContext)
|
||||
{
|
||||
_TestContext = testContext;
|
||||
_TestContextTestName = testContext.TestName;
|
||||
_WebApplicationFactory = new WebApplicationFactory<Server.Program>();
|
||||
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
|
||||
_Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>();
|
||||
@ -34,7 +34,7 @@ public class UnitTestClientSettingsController
|
||||
{
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.AreEqual(IClientSettingsController<object>.GetRouteName(), _ControllerName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -47,7 +47,7 @@ public class UnitTestClientSettingsController
|
||||
List<string>? clientSettings = clientSettingsRepository?.GetClientSettings(null);
|
||||
Assert.IsTrue(clientSettings is not null);
|
||||
#endif
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
#pragma warning disable CS1998
|
||||
@ -67,7 +67,7 @@ public class UnitTestClientSettingsController
|
||||
Assert.IsNotNull(json);
|
||||
Assert.IsTrue(json != "[]");
|
||||
#endif
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
#pragma warning restore CS1998
|
||||
|
||||
@ -79,7 +79,7 @@ public class UnitTestClientSettingsController
|
||||
IClientSettingsRepository? clientSettingsRepository = serviceProvider?.GetRequiredService<IClientSettingsRepository>();
|
||||
string? ipAddress = clientSettingsRepository?.GetIpAddress(null);
|
||||
Assert.IsTrue(ipAddress is not null);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -95,7 +95,7 @@ public class UnitTestClientSettingsController
|
||||
string json = await httpResponseMessage.Content.ReadAsStringAsync();
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetIpAddress)}.json"), json);
|
||||
Assert.IsNotNull(json);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
}
|
@ -16,7 +16,7 @@ public class UnitTestExportController
|
||||
|
||||
private static ILogger? _Logger;
|
||||
private static string _ControllerName;
|
||||
private static TestContext _TestContext;
|
||||
private static string? _TestContextTestName;
|
||||
private static WebApplicationFactory<Server.Program>? _WebApplicationFactory;
|
||||
|
||||
#pragma warning restore
|
||||
@ -24,7 +24,7 @@ public class UnitTestExportController
|
||||
[ClassInitialize]
|
||||
public static void ClassInitAsync(TestContext testContext)
|
||||
{
|
||||
_TestContext = testContext;
|
||||
_TestContextTestName = testContext.TestName;
|
||||
_WebApplicationFactory = new WebApplicationFactory<Server.Program>();
|
||||
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
|
||||
_Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>();
|
||||
@ -43,7 +43,7 @@ public class UnitTestExportController
|
||||
{
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.AreEqual(IExportController<string>.GetRouteName(), _ControllerName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ public class UnitTestExportController
|
||||
IExportRepository? exportRepository = serviceProvider?.GetRequiredService<IExportRepository>();
|
||||
string? result = exportRepository?.GetExport(GetHeaderCommon());
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ public class UnitTestExportController
|
||||
string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/export");
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetExport)}.txt"), result);
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ public class UnitTestExportController
|
||||
Assert.IsTrue(httpClient is not null);
|
||||
HttpResponseMessage httpResponseMessage = await httpClient.PostAsync($"api/{_ControllerName}/export", GetStringContent());
|
||||
Assert.IsTrue(httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ public class UnitTestExportController
|
||||
IExportRepository? exportRepository = serviceProvider?.GetRequiredService<IExportRepository>();
|
||||
Result<HeaderCommon[]>? result = exportRepository?.GetHeaders(GetHeaderCommon());
|
||||
Assert.IsNotNull(result?.Results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ public class UnitTestExportController
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetHeaders)}.json"), json);
|
||||
Result<HeaderCommon[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<HeaderCommon[]>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ public class UnitTestExportController
|
||||
Assert.IsTrue(httpClient is not null);
|
||||
HttpResponseMessage httpResponseMessage = await httpClient.PostAsync($"api/{_ControllerName}/headers", GetStringContent());
|
||||
Assert.IsTrue(httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@ public class UnitTestExportController
|
||||
IExportRepository? exportRepository = serviceProvider?.GetRequiredService<IExportRepository>();
|
||||
Result<HeaderCommon[]>? result = exportRepository?.GetLogistics(GetHeaderCommon());
|
||||
Assert.IsNotNull(result?.Results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -150,7 +150,7 @@ public class UnitTestExportController
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetLogistics)}.json"), json);
|
||||
Result<HeaderCommon[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<HeaderCommon[]>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ public class UnitTestExportController
|
||||
Assert.IsTrue(httpClient is not null);
|
||||
HttpResponseMessage httpResponseMessage = await httpClient.PostAsync($"api/{_ControllerName}/logistics", GetStringContent());
|
||||
Assert.IsTrue(httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -174,7 +174,7 @@ public class UnitTestExportController
|
||||
IExportRepository? exportRepository = serviceProvider?.GetRequiredService<IExportRepository>();
|
||||
string? result = exportRepository?.GetProcessDataStandardFormat(GetHeaderCommon());
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -187,7 +187,7 @@ public class UnitTestExportController
|
||||
string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/processDataStandardFormat");
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetProcessDataStandardFormat)}.pdsf"), result);
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -199,7 +199,7 @@ public class UnitTestExportController
|
||||
Assert.IsTrue(httpClient is not null);
|
||||
HttpResponseMessage httpResponseMessage = await httpClient.PostAsync($"api/{_ControllerName}/processDataStandardFormat", GetStringContent());
|
||||
Assert.IsTrue(httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -215,7 +215,7 @@ public class UnitTestExportController
|
||||
Result<DataTable>? result = exportRepository?.GetExportData(metrologyRepository, toolTypeId: 1, datebegin: null, dateend: null);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
Assert.IsNotNull(result.Results.Rows.Count > 0);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
@ -230,7 +230,7 @@ public class UnitTestExportController
|
||||
Result<DataTable>? result = Newtonsoft.Json.JsonConvert.DeserializeObject<Result<DataTable>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
Assert.IsNotNull(result.Results.Rows.Count > 0);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -243,7 +243,7 @@ public class UnitTestExportController
|
||||
Assert.IsTrue(metrologyRepository is not null);
|
||||
string? result = exportRepository?.GetCSVExport(metrologyRepository, toolTypeId: 1, datebegin: null, dateend: null);
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
@ -256,7 +256,7 @@ public class UnitTestExportController
|
||||
string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/1/csv?datebegin=&dateend=");
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetCSVExport)}.csv"), result);
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
}
|
@ -16,7 +16,7 @@ public class UnitTestFileShareController
|
||||
|
||||
private static ILogger? _Logger;
|
||||
private static string _ControllerName;
|
||||
private static TestContext _TestContext;
|
||||
private static string? _TestContextTestName;
|
||||
private static WebApplicationFactory<Wafer.Counter.Program>? _WebApplicationFactory;
|
||||
|
||||
#pragma warning restore
|
||||
@ -24,7 +24,7 @@ public class UnitTestFileShareController
|
||||
[ClassInitialize]
|
||||
public static void ClassInitAsync(TestContext testContext)
|
||||
{
|
||||
_TestContext = testContext;
|
||||
_TestContextTestName = testContext.TestName;
|
||||
_WebApplicationFactory = new WebApplicationFactory<Wafer.Counter.Program>();
|
||||
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
|
||||
_Logger = serviceProvider.GetRequiredService<ILogger<Wafer.Counter.Program>>();
|
||||
@ -44,7 +44,7 @@ public class UnitTestFileShareController
|
||||
{
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.AreEqual(IFileShareController<string>.GetRouteName(), _ControllerName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ public class UnitTestFileShareController
|
||||
Assert.IsTrue(httpClient is not null);
|
||||
string? response = await httpClient.GetStringAsync($"api/v1/file-share/copy-file/?from=\\\\mesfs.infineon.com\\EC_Metrology_Si\\MetrologyAttachments\\CDERunHeader_\\2024\\WW11\\247233\\CDE5_240315162756858.pdsf&to=\\\\messa01ec.infineon.com\\apps\\Metrology\\MET08RESIMAPCDE\\Test\\a.pdsf");
|
||||
Assert.IsNotNull(response);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ public class UnitTestFileShareController
|
||||
Assert.IsTrue(httpClient is not null);
|
||||
string? response = await httpClient.GetStringAsync($"api/v1/file-share/move-file/?from=\\\\mesfs.infineon.com\\EC_Metrology_Si\\MetrologyAttachments\\CDERunHeader_\\2024\\WW11\\247233\\CDE5_240315162756858.pdsf&to=\\\\messa01ec.infineon.com\\apps\\Metrology\\MET08RESIMAPCDE\\Test\\a.pdsf");
|
||||
Assert.IsNotNull(response);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ public class UnitTestFileShareController
|
||||
Assert.IsTrue(httpClient is not null);
|
||||
string? response = await httpClient.GetStringAsync($"api/v1/file-share/file-write/?path=\\\\messa01ec.infineon.com\\apps\\Metrology\\MET08RESIMAPCDE\\Test\\b.pdsf&contents=b");
|
||||
Assert.IsNotNull(response);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ public class UnitTestFileShareController
|
||||
characterizationParameters = new(string.Empty, "CDE5", "CDE*.json", null, null, "8INCH");
|
||||
result = fileShareRepository?.GetArchiveData(characterizationParameters);
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ public class UnitTestFileShareController
|
||||
Assert.IsTrue(httpClient is not null);
|
||||
string? response = await httpClient.GetStringAsync($"api/v1/file-share/archive-data/?area=FQA&equipment-id=FQA-8INCH&search-pattern=*.wc&wafer-size=8INCH");
|
||||
Assert.IsNotNull(response);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ public class UnitTestFileShareController
|
||||
IFileShareRepository? fileShareRepository = serviceProvider?.GetRequiredService<IFileShareRepository>();
|
||||
ReadOnlyCollection<ToolTypeNameId>? result = fileShareRepository?.GetEquipmentIds();
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ public class UnitTestFileShareController
|
||||
Assert.IsTrue(httpClient is not null);
|
||||
string? response = await httpClient.GetStringAsync($"api/v1/file-share/equipment-ids");
|
||||
Assert.IsNotNull(response);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ public class UnitTestISpreadingResistanceProfileController
|
||||
|
||||
private static ILogger? _Logger;
|
||||
private static string _ControllerName;
|
||||
private static TestContext _TestContext;
|
||||
private static string? _TestContextTestName;
|
||||
private static WebApplicationFactory<Server.Program>? _WebApplicationFactory;
|
||||
|
||||
#pragma warning restore
|
||||
@ -21,7 +21,7 @@ public class UnitTestISpreadingResistanceProfileController
|
||||
[ClassInitialize]
|
||||
public static void ClassInitAsync(TestContext testContext)
|
||||
{
|
||||
_TestContext = testContext;
|
||||
_TestContextTestName = testContext.TestName;
|
||||
_WebApplicationFactory = new WebApplicationFactory<Server.Program>();
|
||||
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
|
||||
_Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>();
|
||||
@ -40,7 +40,7 @@ public class UnitTestISpreadingResistanceProfileController
|
||||
{
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.AreEqual(ISpreadingResistanceProfileController<string>.GetRouteName(), _ControllerName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ public class UnitTestISpreadingResistanceProfileController
|
||||
Assert.IsTrue(bytes.Length != 0);
|
||||
File.WriteAllBytes(Path.Combine(directory, "srp.png"), bytes);
|
||||
}
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ public class UnitTestInfinityQSController
|
||||
|
||||
private static ILogger? _Logger;
|
||||
private static string _ControllerName;
|
||||
private static TestContext _TestContext;
|
||||
private static string? _TestContextTestName;
|
||||
private static WebApplicationFactory<Server.Program>? _WebApplicationFactory;
|
||||
|
||||
#pragma warning restore
|
||||
@ -22,7 +22,7 @@ public class UnitTestInfinityQSController
|
||||
[ClassInitialize]
|
||||
public static void ClassInitAsync(TestContext testContext)
|
||||
{
|
||||
_TestContext = testContext;
|
||||
_TestContextTestName = testContext.TestName;
|
||||
_WebApplicationFactory = new WebApplicationFactory<Server.Program>();
|
||||
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
|
||||
_Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>();
|
||||
@ -41,7 +41,7 @@ public class UnitTestInfinityQSController
|
||||
{
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.AreEqual(IInfinityQSController<string>.GetRouteName(), _ControllerName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ public class UnitTestInfinityQSController
|
||||
IInfinityQSRepository? infinityQSRepository = serviceProvider?.GetRequiredService<IInfinityQSRepository>();
|
||||
string? result = infinityQSRepository?.GetCommandText("1677273357", "61", "CDE5", "5012", "575908", "");
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ public class UnitTestInfinityQSController
|
||||
string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/commandText/?sub_group_id=1677273357&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);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ public class UnitTestInfinityQSController
|
||||
Assert.IsNotNull(result?.Results[0].SE_TSNO);
|
||||
Assert.IsNotNull(result?.Results[0].TD_NAME);
|
||||
Assert.IsNotNull(result?.Results[0].TD_TEST);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ public class UnitTestInfinityQSController
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetData)}.json"), json);
|
||||
Result<InfinityQSBase[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBase[]>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ public class UnitTestInfinityQSController
|
||||
Assert.IsTrue(result?.Results.Length != 0);
|
||||
Assert.IsNotNull(result?.Results[0].SD_SGRP);
|
||||
Assert.IsNotNull(result?.Results[0].SD_TSNO);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ public class UnitTestInfinityQSController
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetDescriptors)}.json"), json);
|
||||
Result<InfinityQSDescriptor[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSDescriptor[]>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ public class UnitTestInfinityQSController
|
||||
IInfinityQSRepository? infinityQSRepository = serviceProvider?.GetRequiredService<IInfinityQSRepository>();
|
||||
Result<InfinityQSEvent[]>? result = infinityQSRepository?.GetEvents("1677273357");
|
||||
Assert.IsNotNull(result?.Results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -179,7 +179,7 @@ public class UnitTestInfinityQSController
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetEvents)}.json"), json);
|
||||
Result<InfinityQSEvent[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSEvent[]>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ public class UnitTestInfinityQSController
|
||||
IInfinityQSRepository? infinityQSRepository = serviceProvider?.GetRequiredService<IInfinityQSRepository>();
|
||||
Result<InfinityQSBase[]>? result = infinityQSRepository?.GetHeader("1677273357");
|
||||
Assert.IsNotNull(result?.Results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -211,7 +211,7 @@ public class UnitTestInfinityQSController
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetHeader)}.json"), json);
|
||||
Result<InfinityQSBase[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBase[]>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
|
||||
private static ILogger? _Logger;
|
||||
private static string _ControllerName;
|
||||
private static TestContext _TestContext;
|
||||
private static string? _TestContextTestName;
|
||||
private static WebApplicationFactory<Server.Program>? _WebApplicationFactory;
|
||||
|
||||
#pragma warning restore
|
||||
@ -22,7 +22,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
[ClassInitialize]
|
||||
public static void ClassInitAsync(TestContext testContext)
|
||||
{
|
||||
_TestContext = testContext;
|
||||
_TestContextTestName = testContext.TestName;
|
||||
_WebApplicationFactory = new WebApplicationFactory<Server.Program>();
|
||||
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
|
||||
_Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>();
|
||||
@ -41,7 +41,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
{
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.AreEqual(IInfinityQSV2Controller<string>.GetRouteName(), _ControllerName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
IInfinityQSV2Repository? infinityQSV2Repository = serviceProvider?.GetRequiredService<IInfinityQSV2Repository>();
|
||||
string? result = infinityQSV2Repository?.GetCommandText("1677273357", "61", "CDE5", "5012", "575908", "");
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1677273357/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);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
Assert.IsNotNull(result?.Results[0].SiteNumber);
|
||||
Assert.IsNotNull(result?.Results[0].VariableNumber);
|
||||
Assert.IsNotNull(result?.Results[0].SubGroupDateTime);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetData)}.json"), json);
|
||||
Result<InfinityQSBaseV2[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBaseV2[]>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
Assert.IsTrue(result?.Results.Length != 0);
|
||||
Assert.IsNotNull(result?.Results[0].SubGroupId);
|
||||
Assert.IsNotNull(result?.Results[0].SiteNumber);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -144,7 +144,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetDescriptors)}.json"), json);
|
||||
Result<InfinityQSDescriptorV2[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSDescriptorV2[]>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -159,7 +159,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
IInfinityQSV2Repository? infinityQSV2Repository = serviceProvider?.GetRequiredService<IInfinityQSV2Repository>();
|
||||
Result<InfinityQSEventV2[]>? result = infinityQSV2Repository?.GetEvents("1677273357");
|
||||
Assert.IsNotNull(result?.Results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetEvents)}.json"), json);
|
||||
Result<InfinityQSEventV2[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSEventV2[]>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -192,7 +192,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
Result<InfinityQSBaseV2[]>? result = infinityQSV2Repository?.GetHeader("1677273357");
|
||||
Assert.IsNotNull(result?.Results);
|
||||
Assert.IsNotNull(result?.Results[0].Part);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -210,7 +210,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
Result<InfinityQSBaseV2[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBaseV2[]>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
Assert.IsNotNull(result?.Results[0].Part);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ public class UnitTestInfinityQSV3Controller
|
||||
|
||||
private static ILogger? _Logger;
|
||||
private static string _ControllerName;
|
||||
private static TestContext _TestContext;
|
||||
private static string? _TestContextTestName;
|
||||
private static WebApplicationFactory<Server.Program>? _WebApplicationFactory;
|
||||
|
||||
#pragma warning restore
|
||||
@ -22,7 +22,7 @@ public class UnitTestInfinityQSV3Controller
|
||||
[ClassInitialize]
|
||||
public static void ClassInitAsync(TestContext testContext)
|
||||
{
|
||||
_TestContext = testContext;
|
||||
_TestContextTestName = testContext.TestName;
|
||||
_WebApplicationFactory = new WebApplicationFactory<Server.Program>();
|
||||
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
|
||||
_Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>();
|
||||
@ -41,7 +41,7 @@ public class UnitTestInfinityQSV3Controller
|
||||
{
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.AreEqual(IInfinityQSV3Controller<string>.GetRouteName(), _ControllerName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ public class UnitTestInfinityQSV3Controller
|
||||
IInfinityQSV3Repository? infinityQSV3Repository = serviceProvider?.GetRequiredService<IInfinityQSV3Repository>();
|
||||
string? result = infinityQSV3Repository?.GetCommandText("1698497987", "61", "CDE5", "5012", "575908", "");
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ public class UnitTestInfinityQSV3Controller
|
||||
string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1698497987/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);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ public class UnitTestInfinityQSV3Controller
|
||||
Assert.IsNotNull(result?.Results[0].SiteNumber);
|
||||
Assert.IsNotNull(result?.Results[0].VariableNumber);
|
||||
Assert.IsNotNull(result?.Results[0].SubGroupDateTime);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ public class UnitTestInfinityQSV3Controller
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetData)}.json"), json);
|
||||
Result<InfinityQSV3[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSV3[]>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ public class UnitTestInfinityQSV3Controller
|
||||
Assert.IsTrue(result?.Results.Length != 0);
|
||||
Assert.IsNotNull(result?.Results[0].SubGroupId);
|
||||
Assert.IsNotNull(result?.Results[0].SiteNumber);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ public class UnitTestInfinityQSV3Controller
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetDescriptors)}.json"), json);
|
||||
Result<InfinityQSDescriptorV3[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSDescriptorV3[]>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ public class UnitTestInfinityQSV3Controller
|
||||
Result<InfinityQSV3[]>? result = infinityQSV3Repository?.GetHeader("1698497987");
|
||||
Assert.IsNotNull(result?.Results);
|
||||
Assert.IsNotNull(result?.Results[0].Part);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -157,7 +157,7 @@ public class UnitTestInfinityQSV3Controller
|
||||
Result<InfinityQSV3[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSV3[]>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
Assert.IsNotNull(result?.Results[0].Part);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ public class UnitTestInfinityQSV3Controller
|
||||
IInfinityQSV3Repository? infinityQSV3Repository = serviceProvider?.GetRequiredService<IInfinityQSV3Repository>();
|
||||
string? result = infinityQSV3Repository?.GetProductDataAverageSumOfDefectsProcessMeanProcessSigma("41", "8IN_THIN ROTR");
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -182,7 +182,7 @@ public class UnitTestInfinityQSV3Controller
|
||||
string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/41/product-data-average-sum-of-defects-process-mean-process-sigma?recipe=8IN_THIN ROTR");
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetProductDataAverageSumOfDefectsProcessMeanProcessSigma)}.json"), result);
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ public class UnitTestInfinityQSV3Controller
|
||||
IInfinityQSV3Repository? infinityQSV3Repository = serviceProvider?.GetRequiredService<IInfinityQSV3Repository>();
|
||||
List<string[]>? results = infinityQSV3Repository?.GetEpiProTempVerificationRows(night);
|
||||
Assert.IsNotNull(results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -208,7 +208,7 @@ public class UnitTestInfinityQSV3Controller
|
||||
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);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -221,7 +221,7 @@ public class UnitTestInfinityQSV3Controller
|
||||
IInfinityQSV3Repository? infinityQSV3Repository = serviceProvider?.GetRequiredService<IInfinityQSV3Repository>();
|
||||
string? result = infinityQSV3Repository?.GetEpiProTempVerification(night);
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -234,7 +234,7 @@ public class UnitTestInfinityQSV3Controller
|
||||
string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/epi-pro-temp-verification/?night=44&night=46&night=52&night=54");
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetEpiProTempVerification)}.html"), result);
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
|
||||
private static ILogger? _Logger;
|
||||
private static string _ControllerName;
|
||||
private static TestContext _TestContext;
|
||||
private static string? _TestContextTestName;
|
||||
private static string _ControllerVersion;
|
||||
private static WebApplicationFactory<Server.Program>? _WebApplicationFactory;
|
||||
|
||||
@ -24,7 +24,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
[ClassInitialize]
|
||||
public static void ClassInitAsync(TestContext testContext)
|
||||
{
|
||||
_TestContext = testContext;
|
||||
_TestContextTestName = testContext.TestName;
|
||||
_WebApplicationFactory = new WebApplicationFactory<Server.Program>();
|
||||
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
|
||||
_Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>();
|
||||
@ -45,7 +45,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.AreEqual(IInfinityQSV4Controller<string>.GetRouteName(), _ControllerName);
|
||||
Assert.AreEqual(IInfinityQSV4Controller<string>.GetRouteVersion(), _ControllerVersion);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
IInfinityQSV4Repository? infinityQSV4Repository = serviceProvider?.GetRequiredService<IInfinityQSV4Repository>();
|
||||
string? result = infinityQSV4Repository?.GetCommandText("1718539249", "61", "CDE5", "5012", "575908", "");
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
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);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
Assert.IsNotNull(result?.Results[0].SiteNumber);
|
||||
Assert.IsNotNull(result?.Results[0].VariableNumber);
|
||||
Assert.IsNotNull(result?.Results[0].SubGroupDateTime);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetData)}.json"), json);
|
||||
Result<InfinityQSV4[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSV4[]>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
Assert.IsTrue(result?.Results.Length != 0);
|
||||
Assert.IsNotNull(result?.Results[0].SubGroupId);
|
||||
Assert.IsNotNull(result?.Results[0].SiteNumber);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetDescriptors)}.json"), json);
|
||||
Result<InfinityQSDescriptorV3[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSDescriptorV3[]>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -146,7 +146,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
Result<InfinityQSV4[]>? result = infinityQSV4Repository?.GetHeader("1718539249");
|
||||
Assert.IsNotNull(result?.Results);
|
||||
Assert.IsNotNull(result?.Results[0].Part);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -161,7 +161,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
Result<InfinityQSV4[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSV4[]>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
Assert.IsNotNull(result?.Results[0].Part);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
IInfinityQSV4Repository? infinityQSV4Repository = serviceProvider?.GetRequiredService<IInfinityQSV4Repository>();
|
||||
string? result = infinityQSV4Repository?.GetProductDataAverageSumOfDefectsProcessMeanProcessSigma("41", "8IN_THIN ROTR");
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -186,7 +186,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
string? result = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/41/product-data-average-sum-of-defects-process-mean-process-sigma?recipe=8IN_THIN ROTR");
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetProductDataAverageSumOfDefectsProcessMeanProcessSigma)}.json"), result);
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -199,7 +199,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
IInfinityQSV4Repository? infinityQSV4Repository = serviceProvider?.GetRequiredService<IInfinityQSV4Repository>();
|
||||
List<string[]>? results = infinityQSV4Repository?.GetEpiProTempVerificationRows(night);
|
||||
Assert.IsNotNull(results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -212,7 +212,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
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);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -225,7 +225,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
IInfinityQSV4Repository? infinityQSV4Repository = serviceProvider?.GetRequiredService<IInfinityQSV4Repository>();
|
||||
string? result = infinityQSV4Repository?.GetEpiProTempVerification(night);
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -238,7 +238,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
string? result = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/epi-pro-temp-verification/?night=44&night=46&night=52&night=54");
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetEpiProTempVerification)}.html"), result);
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -250,7 +250,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
IInfinityQSV4Repository? infinityQSV4Repository = serviceProvider?.GetRequiredService<IInfinityQSV4Repository>();
|
||||
List<Reactor>? results = infinityQSV4Repository?.GetReactors();
|
||||
Assert.IsNotNull(results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -266,7 +266,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
result = infinityQSV4Repository?.GetProductionSpecification(part);
|
||||
Assert.IsNotNull(result);
|
||||
}
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -298,7 +298,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
result = infinityQSV4Repository?.GetProductionSpecification(part);
|
||||
Assert.IsNotNull(result);
|
||||
}
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -313,7 +313,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
IInfinityQSV4Repository? infinityQSV4Repository = serviceProvider?.GetRequiredService<IInfinityQSV4Repository>();
|
||||
string? result = infinityQSV4Repository?.GetLastGroupIdWithValue(process, part, test);
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -329,7 +329,7 @@ public class UnitTestInfinityQSV4Controller
|
||||
string? result = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/{process}/last-group-id-with-value/?part={part}&test={test}");
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetLastGroupIdWithValue)}.html"), result);
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ public class UnitTestOpenInsightV1Controller
|
||||
|
||||
private static ILogger? _Logger;
|
||||
private static string _ControllerName;
|
||||
private static TestContext _TestContext;
|
||||
private static string? _TestContextTestName;
|
||||
private static WebApplicationFactory<Server.Program>? _WebApplicationFactory;
|
||||
|
||||
#pragma warning restore
|
||||
@ -21,7 +21,7 @@ public class UnitTestOpenInsightV1Controller
|
||||
[ClassInitialize]
|
||||
public static void ClassInitAsync(TestContext testContext)
|
||||
{
|
||||
_TestContext = testContext;
|
||||
_TestContextTestName = testContext.TestName;
|
||||
_WebApplicationFactory = new WebApplicationFactory<Server.Program>();
|
||||
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
|
||||
_Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>();
|
||||
@ -40,7 +40,7 @@ public class UnitTestOpenInsightV1Controller
|
||||
{
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.AreEqual(IOpenInsightV1Controller<string>.GetRouteName(), _ControllerName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -51,7 +51,7 @@ public class UnitTestOpenInsightV1Controller
|
||||
IOpenInsightV1Repository? openInsightRepository = serviceProvider?.GetRequiredService<IOpenInsightV1Repository>();
|
||||
string? result = openInsightRepository?.GetTencorRun("615071", "10/30/2023 06:48:34PM", "6IN_EPP ROTR");
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ public class UnitTestOpenInsightV1Controller
|
||||
string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/615071/tencor-run?insert_date=10/30/2023 06:48:34PM&recipe=6IN_EPP ROTR");
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetTencorRun)}.json"), result);
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ public class UnitTestPinController
|
||||
|
||||
private static ILogger? _Logger;
|
||||
private static string _ControllerName;
|
||||
private static TestContext _TestContext;
|
||||
private static string? _TestContextTestName;
|
||||
private static WebApplicationFactory<Server.Program>? _WebApplicationFactory;
|
||||
|
||||
#pragma warning restore
|
||||
@ -22,7 +22,7 @@ public class UnitTestPinController
|
||||
[ClassInitialize]
|
||||
public static void ClassInitAsync(TestContext testContext)
|
||||
{
|
||||
_TestContext = testContext;
|
||||
_TestContextTestName = testContext.TestName;
|
||||
_WebApplicationFactory = new WebApplicationFactory<Server.Program>();
|
||||
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
|
||||
_Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>();
|
||||
@ -34,7 +34,7 @@ public class UnitTestPinController
|
||||
{
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.AreEqual(IPinController<string>.GetRouteName(), _ControllerName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -44,10 +44,10 @@ public class UnitTestPinController
|
||||
IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider;
|
||||
IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>();
|
||||
IPinRepository? pinRepository = serviceProvider?.GetRequiredService<IPinRepository>();
|
||||
Assert.IsTrue(metrologyRepository is not null);
|
||||
Assert.IsNotNull(metrologyRepository);
|
||||
Result<Pinned[]>? result = pinRepository?.GetPinnedTable(metrologyRepository, id: 1, cde_id: null, biorad_id: null, rds: null);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -55,12 +55,12 @@ public class UnitTestPinController
|
||||
{
|
||||
HttpClient? httpClient = _WebApplicationFactory?.CreateClient();
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.IsTrue(httpClient is not null);
|
||||
Assert.IsNotNull(httpClient);
|
||||
string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/-1/pinned");
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetPinnedTable)}.json"), json);
|
||||
Result<Pinned[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<Pinned[]>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
}
|
@ -14,7 +14,7 @@ public class UnitTestServiceShopOrderController
|
||||
|
||||
private static ILogger? _Logger;
|
||||
private static string _ControllerName;
|
||||
private static TestContext _TestContext;
|
||||
private static string? _TestContextTestName;
|
||||
private static WebApplicationFactory<Server.Program>? _WebApplicationFactory;
|
||||
|
||||
#pragma warning restore
|
||||
@ -22,7 +22,7 @@ public class UnitTestServiceShopOrderController
|
||||
[ClassInitialize]
|
||||
public static void ClassInitAsync(TestContext testContext)
|
||||
{
|
||||
_TestContext = testContext;
|
||||
_TestContextTestName = testContext.TestName;
|
||||
_WebApplicationFactory = new WebApplicationFactory<Server.Program>();
|
||||
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
|
||||
_Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>();
|
||||
@ -34,7 +34,7 @@ public class UnitTestServiceShopOrderController
|
||||
{
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.AreEqual(IServiceShopOrderController<string>.GetRouteName(), _ControllerName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -44,7 +44,7 @@ public class UnitTestServiceShopOrderController
|
||||
throw new NullReferenceException(nameof(_Logger));
|
||||
ServiceShopOrder[] serviceShopOrders = IServiceShopOrder.GetServiceShopOrders(null);
|
||||
Assert.IsNotNull(serviceShopOrders);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -60,7 +60,7 @@ public class UnitTestServiceShopOrderController
|
||||
serviceShopOrders = await serviceShopOrderRepository.GetServiceShopOrders("23188d3d-9b75-ed11-ab8b-0050568f2fc3");
|
||||
Assert.IsTrue(serviceShopOrders is not null && serviceShopOrders.Length != 0);
|
||||
Assert.IsNotNull(serviceShopOrders[0].ToString());
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -75,7 +75,7 @@ public class UnitTestServiceShopOrderController
|
||||
ServiceShopOrder[]? serviceShopOrders = System.Text.Json.JsonSerializer.Deserialize<ServiceShopOrder[]>(json);
|
||||
Assert.IsNotNull(serviceShopOrders);
|
||||
Assert.IsTrue(serviceShopOrders.Length != 0);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
}
|
@ -17,7 +17,7 @@ public class UnitTestToolTypesController
|
||||
|
||||
private static ILogger? _Logger;
|
||||
private static string _ControllerName;
|
||||
private static TestContext _TestContext;
|
||||
private static string? _TestContextTestName;
|
||||
private static WebApplicationFactory<Server.Program>? _WebApplicationFactory;
|
||||
|
||||
#pragma warning restore
|
||||
@ -25,7 +25,7 @@ public class UnitTestToolTypesController
|
||||
[ClassInitialize]
|
||||
public static void ClassInitAsync(TestContext testContext)
|
||||
{
|
||||
_TestContext = testContext;
|
||||
_TestContextTestName = testContext.TestName;
|
||||
_WebApplicationFactory = new WebApplicationFactory<Server.Program>();
|
||||
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
|
||||
_Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>();
|
||||
@ -44,7 +44,7 @@ public class UnitTestToolTypesController
|
||||
{
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.AreEqual(IToolTypesController<string>.GetRouteName(), _ControllerName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -59,7 +59,7 @@ public class UnitTestToolTypesController
|
||||
Assert.IsNotNull(result?.Results);
|
||||
Assert.IsTrue(result.Results.Length != 0);
|
||||
Assert.IsFalse(result.Results.All(l => l.ID == 0));
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -74,7 +74,7 @@ public class UnitTestToolTypesController
|
||||
Assert.IsNotNull(result?.Results);
|
||||
Assert.IsTrue(result.Results.Length != 0);
|
||||
Assert.IsFalse(result.Results.All(l => l.ID == 0));
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -90,7 +90,7 @@ public class UnitTestToolTypesController
|
||||
Assert.IsNotNull(result.Results.Metadata);
|
||||
Assert.IsTrue(result.Results.Metadata.Length != 0);
|
||||
Assert.IsFalse(result.Results.Metadata.All(l => l.ToolTypeID == 0));
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -106,7 +106,7 @@ public class UnitTestToolTypesController
|
||||
Assert.IsNotNull(result.Results.Metadata);
|
||||
Assert.IsTrue(result.Results.Metadata.Length != 0);
|
||||
Assert.IsFalse(result.Results.Metadata.All(l => l.ToolTypeID == 0));
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -120,7 +120,7 @@ public class UnitTestToolTypesController
|
||||
Result<DataTable>? result = toolTypesRepository?.GetHeaders(metrologyRepository, id: 1, datebegin: null, dateend: null, page: null, pagesize: null, headerid: null);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
Assert.IsNotNull(result.Results.Rows.Count > 0);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -134,7 +134,7 @@ public class UnitTestToolTypesController
|
||||
Result<DataTable>? result = Newtonsoft.Json.JsonConvert.DeserializeObject<Result<DataTable>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
Assert.IsNotNull(result.Results.Rows.Count > 0);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -148,7 +148,7 @@ public class UnitTestToolTypesController
|
||||
Result<HeaderCommon[]>? result = toolTypesRepository?.GetHeaderTitles(metrologyRepository, id: -1, page: null, pagesize: null);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
Assert.IsTrue(result?.Results.Length != 0);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -162,7 +162,7 @@ public class UnitTestToolTypesController
|
||||
Result<HeaderCommon[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<HeaderCommon[]>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
Assert.IsTrue(result.Results.Length != 0);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -176,7 +176,7 @@ public class UnitTestToolTypesController
|
||||
Result<ColumnValue[]>? result = toolTypesRepository?.GetHeaderFields(metrologyRepository, id: 1, headerid: 1);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
Assert.IsTrue(result.Results.Length != 0);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -190,7 +190,7 @@ public class UnitTestToolTypesController
|
||||
Result<ColumnValue[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<ColumnValue[]>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
Assert.IsTrue(result.Results.Length != 0);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -204,7 +204,7 @@ public class UnitTestToolTypesController
|
||||
Result<DataTable>? result = toolTypesRepository?.GetData(metrologyRepository, id: 1, headerid: 1);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
Assert.IsNotNull(result.Results.Rows.Count > 0);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -218,7 +218,7 @@ public class UnitTestToolTypesController
|
||||
Result<DataTable>? result = Newtonsoft.Json.JsonConvert.DeserializeObject<Result<DataTable>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
Assert.IsNotNull(result.Results.Rows.Count > 0);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
@ -239,7 +239,7 @@ public class UnitTestToolTypesController
|
||||
Assert.IsTrue(toolTypesRepository is not null);
|
||||
(string? message, string? _, Stream? _) = toolTypesRepository.GetAttachment(metrologyRepository, attachmentsService, toolTypeId, tabletype, attachmentId, filename);
|
||||
Assert.IsTrue(message is null);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
@ -250,7 +250,7 @@ public class UnitTestToolTypesController
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.IsTrue(httpClient is not null);
|
||||
_ = await httpClient.GetFromJsonAsync<object>($"api/{_ControllerName}/1/data/files/ffdf5410-ca19-4097-bfa4-b398e236d07e/data.txt");
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
@ -268,7 +268,7 @@ public class UnitTestToolTypesController
|
||||
Assert.IsTrue(metrologyRepository is not null);
|
||||
string? message = toolTypesRepository?.OIExport(metrologyRepository, attachmentsService, toolTypeId: 1, headerid: 1);
|
||||
Assert.IsTrue(message is null);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
@ -279,7 +279,7 @@ public class UnitTestToolTypesController
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.IsTrue(httpClient is not null);
|
||||
_ = await httpClient.GetFromJsonAsync<object>($"api/{_ControllerName}/1/headers/1/export");
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
}
|
||||
|
||||
}
|
@ -14,7 +14,7 @@ public class UnitTestWaferCounterController
|
||||
|
||||
private static ILogger? _Logger;
|
||||
private static string _ControllerName;
|
||||
private static TestContext _TestContext;
|
||||
private static string? _TestContextTestName;
|
||||
private static WebApplicationFactory<Wafer.Counter.Program>? _WebApplicationFactory;
|
||||
|
||||
#pragma warning restore
|
||||
@ -22,7 +22,7 @@ public class UnitTestWaferCounterController
|
||||
[ClassInitialize]
|
||||
public static void ClassInitAsync(TestContext testContext)
|
||||
{
|
||||
_TestContext = testContext;
|
||||
_TestContextTestName = testContext.TestName;
|
||||
_WebApplicationFactory = new WebApplicationFactory<Wafer.Counter.Program>();
|
||||
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
|
||||
_Logger = serviceProvider.GetRequiredService<ILogger<Wafer.Counter.Program>>();
|
||||
@ -41,7 +41,7 @@ public class UnitTestWaferCounterController
|
||||
{
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.AreEqual(IFileShareController<string>.GetRouteName(), _ControllerName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ public class UnitTestWaferCounterController
|
||||
IWaferCounterRepository? waferCounterRepository = serviceProvider?.GetRequiredService<IWaferCounterRepository>();
|
||||
WaferCounter? result = waferCounterRepository?.GetLastQuantityAndSlotMap(area: "FQA", waferSize: "8INCH", text: "Test");
|
||||
Assert.IsNotNull(result);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ public class UnitTestWaferCounterController
|
||||
Assert.IsTrue(httpClient is not null);
|
||||
string? response = await httpClient.GetStringAsync($"api/v1/{_ControllerName}/FQA/last-quantity-and-slot-map/?waferSize=8INCH&text=Test");
|
||||
Assert.IsNotNull(response);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
|
@ -8,9 +8,9 @@ namespace OI.Metrology.Wafer.Counter.ApiControllers;
|
||||
public class AppSettingsController : ControllerBase, IAppSettingsController<ActionResult>
|
||||
{
|
||||
|
||||
private readonly IAppSettingsRepository<Models.Binder.AppSettings> _AppSettingsRepository;
|
||||
private readonly IAppSettingsRepository<Models.AppSettings> _AppSettingsRepository;
|
||||
|
||||
public AppSettingsController(IAppSettingsRepository<Models.Binder.AppSettings> AppSettingsRepository) =>
|
||||
public AppSettingsController(IAppSettingsRepository<Models.AppSettings> AppSettingsRepository) =>
|
||||
_AppSettingsRepository = AppSettingsRepository;
|
||||
|
||||
[HttpGet(nameof(IAppSettingsController<ActionResult>.Action.App))]
|
||||
|
@ -26,6 +26,52 @@ public record AppSettings(string AzureDevOpsDestinationDirectory,
|
||||
return result;
|
||||
}
|
||||
|
||||
private static void Verify(AppSettings appSettings)
|
||||
{
|
||||
if (string.IsNullOrEmpty(appSettings.Company))
|
||||
throw new Exception("Company name must have a value!");
|
||||
if (string.IsNullOrEmpty(appSettings.WorkingDirectoryName))
|
||||
throw new Exception("Working directory name must have a value!");
|
||||
}
|
||||
|
||||
public static AppSettings Get(IConfigurationRoot configurationRoot)
|
||||
{
|
||||
AppSettings result;
|
||||
AppSettings? appSettings = configurationRoot.GetSection(nameof(AppSettings)).Get<AppSettings>();
|
||||
#pragma warning restore IL3050, IL2026
|
||||
if (appSettings is null
|
||||
|| appSettings?.Company is null)
|
||||
{
|
||||
List<string> paths = [];
|
||||
foreach (IConfigurationProvider configurationProvider in configurationRoot.Providers)
|
||||
{
|
||||
if (configurationProvider is not Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider jsonConfigurationProvider)
|
||||
continue;
|
||||
if (jsonConfigurationProvider.Source.FileProvider is not Microsoft.Extensions.FileProviders.PhysicalFileProvider physicalFileProvider)
|
||||
continue;
|
||||
paths.Add(physicalFileProvider.Root);
|
||||
}
|
||||
throw new NotSupportedException($"Not found!{Environment.NewLine}{string.Join(Environment.NewLine, paths.Distinct())}");
|
||||
}
|
||||
result = new(appSettings.AzureDevOpsDestinationDirectory,
|
||||
appSettings.BuildNumber,
|
||||
appSettings.Company,
|
||||
appSettings.EcCharacterizationSi,
|
||||
appSettings.EcMesaFileShareCharacterizationSi,
|
||||
appSettings.GitCommitSeven,
|
||||
appSettings.IsDevelopment,
|
||||
appSettings.IsStaging,
|
||||
appSettings.MockRoot,
|
||||
appSettings.MonAResource,
|
||||
appSettings.MonASite,
|
||||
appSettings.URLs,
|
||||
appSettings.WaferCounterDestinationDirectory,
|
||||
appSettings.WaferCounterTwoFileSecondsWait,
|
||||
appSettings.WorkingDirectoryName);
|
||||
Verify(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
|
@ -1,2 +0,0 @@
|
||||
[*.cs]
|
||||
csharp_preserve_single_line_statements = true
|
@ -1,102 +0,0 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace OI.Metrology.Wafer.Counter.Models.Binder;
|
||||
|
||||
public class AppSettings
|
||||
{
|
||||
|
||||
public string? AzureDevOpsDestinationDirectory { get; set; }
|
||||
public string? BuildNumber { get; set; }
|
||||
public string? Company { get; set; }
|
||||
public string? EcCharacterizationSi { get; set; }
|
||||
public string? EcMesaFileShareCharacterizationSi { get; set; }
|
||||
public string? GitCommitSeven { get; set; }
|
||||
public bool? IsDevelopment { get; set; }
|
||||
public bool? IsStaging { get; set; }
|
||||
public string? MockRoot { get; set; }
|
||||
public string? MonAResource { get; set; }
|
||||
public string? MonASite { get; set; }
|
||||
public string? URLs { get; set; }
|
||||
public string? WaferCounterDestinationDirectory { get; set; }
|
||||
public int? WaferCounterTwoFileSecondsWait { get; set; }
|
||||
public string? WorkingDirectoryName { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, BinderAppSettingsSourceGenerationContext.Default.AppSettings);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static void PreVerify(IConfigurationRoot configurationRoot, AppSettings? appSettings)
|
||||
{
|
||||
if (appSettings?.Company is null)
|
||||
{
|
||||
List<string> paths = new();
|
||||
foreach (IConfigurationProvider configurationProvider in configurationRoot.Providers)
|
||||
{
|
||||
if (configurationProvider is not Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider jsonConfigurationProvider)
|
||||
continue;
|
||||
if (jsonConfigurationProvider.Source.FileProvider is not Microsoft.Extensions.FileProviders.PhysicalFileProvider physicalFileProvider)
|
||||
continue;
|
||||
paths.Add(physicalFileProvider.Root);
|
||||
}
|
||||
throw new NotSupportedException($"Not found!{Environment.NewLine}{string.Join(Environment.NewLine, paths.Distinct())}");
|
||||
}
|
||||
}
|
||||
|
||||
private static Models.AppSettings Get(AppSettings? appSettings)
|
||||
{
|
||||
Models.AppSettings result;
|
||||
if (appSettings is null) throw new NullReferenceException(nameof(appSettings));
|
||||
if (appSettings.AzureDevOpsDestinationDirectory is null) throw new NullReferenceException(nameof(AzureDevOpsDestinationDirectory));
|
||||
if (appSettings.BuildNumber is null) throw new NullReferenceException(nameof(BuildNumber));
|
||||
if (appSettings.Company is null) throw new NullReferenceException(nameof(Company));
|
||||
if (appSettings.EcCharacterizationSi is null) throw new NullReferenceException(nameof(EcCharacterizationSi));
|
||||
if (appSettings.EcMesaFileShareCharacterizationSi is null) throw new NullReferenceException(nameof(EcMesaFileShareCharacterizationSi));
|
||||
if (appSettings.GitCommitSeven is null) throw new NullReferenceException(nameof(GitCommitSeven));
|
||||
if (appSettings.IsDevelopment is null) throw new NullReferenceException(nameof(IsDevelopment));
|
||||
if (appSettings.IsStaging is null) throw new NullReferenceException(nameof(IsStaging));
|
||||
if (appSettings.MockRoot is null) throw new NullReferenceException(nameof(MockRoot));
|
||||
if (appSettings.MonAResource is null) throw new NullReferenceException(nameof(MonAResource));
|
||||
if (appSettings.MonASite is null) throw new NullReferenceException(nameof(MonASite));
|
||||
if (appSettings.URLs is null) throw new NullReferenceException(nameof(URLs));
|
||||
if (appSettings.WaferCounterDestinationDirectory is null) throw new NullReferenceException(nameof(WaferCounterDestinationDirectory));
|
||||
if (appSettings.WaferCounterTwoFileSecondsWait is null) throw new NullReferenceException(nameof(WaferCounterTwoFileSecondsWait));
|
||||
if (appSettings.WorkingDirectoryName is null) throw new NullReferenceException(nameof(WorkingDirectoryName));
|
||||
result = new(appSettings.AzureDevOpsDestinationDirectory,
|
||||
appSettings.BuildNumber,
|
||||
appSettings.Company,
|
||||
appSettings.EcCharacterizationSi,
|
||||
appSettings.EcMesaFileShareCharacterizationSi,
|
||||
appSettings.GitCommitSeven,
|
||||
appSettings.IsDevelopment.Value,
|
||||
appSettings.IsStaging.Value,
|
||||
appSettings.MockRoot,
|
||||
appSettings.MonAResource,
|
||||
appSettings.MonASite,
|
||||
appSettings.URLs,
|
||||
appSettings.WaferCounterDestinationDirectory,
|
||||
appSettings.WaferCounterTwoFileSecondsWait.Value,
|
||||
appSettings.WorkingDirectoryName);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Models.AppSettings Get(IConfigurationRoot configurationRoot)
|
||||
{
|
||||
Models.AppSettings result;
|
||||
#pragma warning disable IL3050, IL2026
|
||||
AppSettings? appSettings = configurationRoot.Get<AppSettings>();
|
||||
#pragma warning restore IL3050, IL2026
|
||||
PreVerify(configurationRoot, appSettings);
|
||||
result = Get(appSettings);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(AppSettings))]
|
||||
internal partial class BinderAppSettingsSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
@ -14,11 +14,7 @@ public class Program
|
||||
ILogger<Program>? logger = null;
|
||||
WebApplicationBuilder webApplicationBuilder = WebApplication.CreateBuilder(args);
|
||||
_ = webApplicationBuilder.Configuration.AddUserSecrets<Program>();
|
||||
AppSettings appSettings = Models.Binder.AppSettings.Get(webApplicationBuilder.Configuration);
|
||||
if (string.IsNullOrEmpty(appSettings.Company))
|
||||
throw new Exception("Company name must have a value!");
|
||||
if (string.IsNullOrEmpty(appSettings.WorkingDirectoryName))
|
||||
throw new Exception("Working directory name must have a value!");
|
||||
AppSettings appSettings = AppSettings.Get(webApplicationBuilder.Configuration);
|
||||
try
|
||||
{
|
||||
_ = webApplicationBuilder.Services.AddMemoryCache();
|
||||
@ -33,7 +29,7 @@ public class Program
|
||||
_ = webApplicationBuilder.Services.AddSingleton<IFileShareRepository, FileShareRepository>();
|
||||
_ = webApplicationBuilder.Services.AddSingleton<IAzureDevOpsRepository, AzureDevOpsRepository>();
|
||||
_ = webApplicationBuilder.Services.AddSingleton<IWaferCounterRepository, WaferCounterRepository>();
|
||||
_ = webApplicationBuilder.Services.AddSingleton<IAppSettingsRepository<Models.Binder.AppSettings>>(_ => appSettingsRepository);
|
||||
_ = webApplicationBuilder.Services.AddSingleton<IAppSettingsRepository<AppSettings>>(_ => appSettingsRepository);
|
||||
|
||||
_ = webApplicationBuilder.Services.AddSwaggerGen();
|
||||
_ = webApplicationBuilder.Services.AddSession(sessionOptions =>
|
||||
|
@ -3,27 +3,18 @@ using OI.Metrology.Shared.Models.Stateless;
|
||||
|
||||
namespace OI.Metrology.Wafer.Counter.Repository;
|
||||
|
||||
public class AppSettingsRepository : IAppSettingsRepository<Models.Binder.AppSettings>
|
||||
public class AppSettingsRepository : IAppSettingsRepository<AppSettings>
|
||||
{
|
||||
|
||||
private readonly AppSettings _AppSettings;
|
||||
|
||||
public AppSettingsRepository(AppSettings appSettings) => _AppSettings = appSettings;
|
||||
public AppSettingsRepository(AppSettings appSettings) =>
|
||||
_AppSettings = appSettings;
|
||||
|
||||
internal Models.Binder.AppSettings GetAppSettings()
|
||||
{
|
||||
Models.Binder.AppSettings result = new()
|
||||
{
|
||||
BuildNumber = _AppSettings.BuildNumber,
|
||||
Company = _AppSettings.Company,
|
||||
GitCommitSeven = _AppSettings.GitCommitSeven,
|
||||
IsDevelopment = _AppSettings.IsDevelopment,
|
||||
IsStaging = _AppSettings.IsStaging,
|
||||
};
|
||||
return result;
|
||||
}
|
||||
internal AppSettings GetAppSettings() =>
|
||||
_AppSettings;
|
||||
|
||||
Models.Binder.AppSettings IAppSettingsRepository<Models.Binder.AppSettings>.GetAppSettings() => GetAppSettings();
|
||||
AppSettings IAppSettingsRepository<AppSettings>.GetAppSettings() => GetAppSettings();
|
||||
|
||||
internal string GetBuildNumberAndGitCommitSeven()
|
||||
{
|
||||
@ -31,10 +22,10 @@ public class AppSettingsRepository : IAppSettingsRepository<Models.Binder.AppSet
|
||||
return result;
|
||||
}
|
||||
|
||||
string IAppSettingsRepository<Models.Binder.AppSettings>.GetBuildNumberAndGitCommitSeven() =>
|
||||
string IAppSettingsRepository<AppSettings>.GetBuildNumberAndGitCommitSeven() =>
|
||||
GetBuildNumberAndGitCommitSeven();
|
||||
|
||||
void IAppSettingsRepository<Models.Binder.AppSettings>.VerifyConnectionStrings() =>
|
||||
void IAppSettingsRepository<AppSettings>.VerifyConnectionStrings() =>
|
||||
throw new NotImplementedException();
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user