Characterization Data with Static Site

This commit is contained in:
2024-09-23 10:27:36 -07:00
parent 4c2bef71ec
commit 018382e218
11 changed files with 273 additions and 130 deletions

View File

@ -1,8 +1,10 @@
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using OI.Metrology.Shared.DataModels;
using OI.Metrology.Shared.Models;
using OI.Metrology.Shared.Models.Stateless;
using System.Collections.ObjectModel;
namespace OI.Metrology.Tests;
@ -88,7 +90,7 @@ public class UnitTestFileShareController
public void GetArchiveData()
{
_Logger?.LogInformation("Starting Web Application");
List<CharacterizationInfo>? result;
ReadOnlyCollection<CharacterizationInfo>? result;
CharacterizationParameters characterizationParameters;
IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider;
IFileShareRepository? fileShareRepository = serviceProvider?.GetRequiredService<IFileShareRepository>();
@ -117,4 +119,28 @@ public class UnitTestFileShareController
NonThrowTryCatch();
}
[TestMethod]
public void EquipmentIds()
{
_Logger?.LogInformation("Starting Web Application");
IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider;
IFileShareRepository? fileShareRepository = serviceProvider?.GetRequiredService<IFileShareRepository>();
ReadOnlyCollection<ToolTypeNameId>? result = fileShareRepository?.GetEquipmentIds();
Assert.IsNotNull(result);
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
NonThrowTryCatch();
}
[TestMethod]
public async Task EquipmentIdsApi()
{
HttpClient? httpClient = _WebApplicationFactory?.CreateClient();
_Logger?.LogInformation("Starting Web Application");
Assert.IsTrue(httpClient is not null);
string? response = await httpClient.GetStringAsync($"api/v1/file-share/equipment-ids");
Assert.IsNotNull(response);
_Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
NonThrowTryCatch();
}
}