thunder-collection

This commit is contained in:
2023-02-25 12:52:18 -07:00
parent 97c9c3c264
commit bff76a503a
3 changed files with 129 additions and 0 deletions

View File

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