Dynamic 5 and 14 point copy
AppSettings alignment with other projects _TestContextTestName over _TestContext
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user