diff --git a/DD.Persistence.IntegrationTests/Controllers/SetpointControllerTest.cs b/DD.Persistence.IntegrationTests/Controllers/SetpointControllerTest.cs index 48b6ab0..55cbba6 100644 --- a/DD.Persistence.IntegrationTests/Controllers/SetpointControllerTest.cs +++ b/DD.Persistence.IntegrationTests/Controllers/SetpointControllerTest.cs @@ -2,6 +2,7 @@ using DD.Persistence.Client; using DD.Persistence.Client.Clients; using DD.Persistence.Client.Clients.Interfaces; using DD.Persistence.Client.Clients.Interfaces.Refit; +using DD.Persistence.Client.Clients.Mapping; using DD.Persistence.Database.Entity; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -13,17 +14,14 @@ namespace DD.Persistence.IntegrationTests.Controllers public class SetpointControllerTest : BaseIntegrationTest { private readonly ISetpointClient setpointClient; - private readonly MappingConfigStorage configStorage; public SetpointControllerTest(WebAppFactoryFixture factory) : base(factory) { var refitClientFactory = scope.ServiceProvider .GetRequiredService>(); - var logger = scope.ServiceProvider.GetRequiredService>(); setpointClient = scope.ServiceProvider .GetRequiredService(); - configStorage = (MappingConfigStorage)scope.ServiceProvider.GetRequiredService(); } @@ -32,12 +30,16 @@ namespace DD.Persistence.IntegrationTests.Controllers { var id = Guid.Parse("e0fcad22-1761-476e-a729-a3c59d51ba41"); - configStorage.AddOrReplace(id, typeof(float)); + var config = new Dictionary(); + config[id] = typeof(float); + + var setpointMapper = new SetpointMappingClient(setpointClient, config); + await setpointClient.Add(id, 48.3f, CancellationToken.None); //act - var response = await setpointClient.GetCurrent([id], CancellationToken.None); + var response = await setpointMapper.GetCurrent([id], CancellationToken.None); //assert Assert.NotNull(response);