Dynamic 5 and 14 point copy

AppSettings alignment with other projects

_TestContextTestName over _TestContext
This commit is contained in:
2025-05-02 15:22:18 -07:00
parent 2afb312065
commit 6f52566fc2
30 changed files with 415 additions and 326 deletions

View File

@ -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();
}