thunder-collection
This commit is contained in:
@ -42,8 +42,10 @@ public class UnitTestClientSettingsController
|
||||
_Logger.Information("Starting Web Application");
|
||||
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
|
||||
IClientSettingsRepository clientSettingsRepository = serviceProvider.GetRequiredService<IClientSettingsRepository>();
|
||||
#if DEBUG
|
||||
List<string> clientSettings = clientSettingsRepository.GetClientSettings(null);
|
||||
Assert.IsTrue(clientSettings is not null);
|
||||
#endif
|
||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||
}
|
||||
|
||||
@ -53,6 +55,7 @@ public class UnitTestClientSettingsController
|
||||
HttpClient httpClient = _WebApplicationFactory.CreateClient();
|
||||
_Logger.Information("Starting Web Application");
|
||||
string actionName = nameof(IClientSettingsController<object>.Action.Client);
|
||||
#if DEBUG
|
||||
HttpResponseMessage httpResponseMessage = await httpClient.GetAsync($"api/{_ControllerName}/{actionName}");
|
||||
Assert.AreEqual(HttpStatusCode.OK, httpResponseMessage.StatusCode);
|
||||
Assert.AreEqual("application/json; charset=utf-8", httpResponseMessage.Content.Headers.ContentType?.ToString());
|
||||
@ -60,6 +63,7 @@ public class UnitTestClientSettingsController
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetClientSettings)}.json"), json);
|
||||
Assert.IsNotNull(json);
|
||||
Assert.IsTrue(json != "[]");
|
||||
#endif
|
||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user