Host from Windows
This commit is contained in:
@ -221,36 +221,6 @@ public class UnitTestToolTypesController
|
||||
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
[TestMethod]
|
||||
public void GetExportData()
|
||||
{
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider;
|
||||
IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>();
|
||||
IToolTypesRepository? toolTypesRepository = serviceProvider?.GetRequiredService<IToolTypesRepository>();
|
||||
Assert.IsTrue(metrologyRepository is not null);
|
||||
Result<DataTable>? result = toolTypesRepository?.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);
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
[TestMethod]
|
||||
public async Task GetExportDataApi()
|
||||
{
|
||||
HttpClient? httpClient = _WebApplicationFactory?.CreateClient();
|
||||
_Logger?.LogInformation("Starting Web Application");
|
||||
Assert.IsTrue(httpClient is not null);
|
||||
string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1/export");
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetExportData)}.json"), json);
|
||||
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);
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
[TestMethod]
|
||||
public void GetAttachment()
|
||||
|
Reference in New Issue
Block a user