From ea9800e561a604251db47156823cf33340ae39ae Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Mon, 14 Oct 2024 12:07:03 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20=D0=B0?= =?UTF-8?q?=D0=B2=D1=82=D0=BE=D1=82=D0=B5=D1=81=D1=82=D0=B0=20=D0=BF=D0=BE?= =?UTF-8?q?=20=D1=80=D0=B5=D0=B7=D1=83=D0=BB=D1=8C=D1=82=D0=B0=D1=82=D0=B0?= =?UTF-8?q?=D0=BC=20=D1=80=D0=B5=D0=B2=D1=8C=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataSaubStatDtillingQualityServiceTest.cs | 20 +++++++++---------- .../SAUB/TelemetryDataEditorService.cs | 2 ++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/AsbCloudInfrastructure.Tests/Services/DataSaubStat/DataSaubStatDtillingQualityServiceTest.cs b/AsbCloudInfrastructure.Tests/Services/DataSaubStat/DataSaubStatDtillingQualityServiceTest.cs index 8e9485f5..04fe2b83 100644 --- a/AsbCloudInfrastructure.Tests/Services/DataSaubStat/DataSaubStatDtillingQualityServiceTest.cs +++ b/AsbCloudInfrastructure.Tests/Services/DataSaubStat/DataSaubStatDtillingQualityServiceTest.cs @@ -1,20 +1,15 @@ using AsbCloudApp.Data; using AsbCloudApp.Data.SAUB; using AsbCloudApp.Repositories; -using AsbCloudApp.Requests; using AsbCloudApp.Services; -using AsbCloudDb.Model; using AsbCloudInfrastructure.Services; using AsbCloudInfrastructure.Tests.MapData; using CsvHelper; -using Mapster; using NSubstitute; using System; -using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; -using System.Net.NetworkInformation; using System.Reflection; using System.Threading; using System.Threading.Tasks; @@ -24,7 +19,6 @@ namespace AsbCloudInfrastructure.Tests.Services; public class DataSaubStatDtillingQualityServiceTest { - private const string UsingTemplateFile = "AsbCloudInfrastructure/Tests/Services/DataSaubStat"; private readonly IDataSaubStatRepository dataSaubStatRepositoryMock = Substitute.For>(); private readonly ITelemetryDataCache telemetryDataCacheMock = Substitute.For>(); private readonly ITelemetryDataSaubService dataSaubServiceMock = Substitute.For(); @@ -39,13 +33,16 @@ public class DataSaubStatDtillingQualityServiceTest dataSaubServiceMock); } - - [Fact] - public async Task Create_DataSaubStatDrillingQuality_From_CSVFile_Test1_ShouldReturn_Success() + [Theory] + [InlineData("DataSaubStat.test1.csv", "DataSaubStat.test1_result.csv")] + public async Task Create_DataSaubStatDrillingQuality_From_CSVFile_ShouldReturn_Success( + string pathMockData, + string pathResult + ) { var resourceName = Assembly.GetExecutingAssembly() .GetManifestResourceNames() - .Where(r => r.Contains("DataSaubStat.test1.csv")) + .Where(r => r.Contains(pathMockData)) .FirstOrDefault(); if (String.IsNullOrEmpty(resourceName)) @@ -72,7 +69,7 @@ public class DataSaubStatDtillingQualityServiceTest resourceName = Assembly.GetExecutingAssembly() .GetManifestResourceNames() - .Where(r => r.Contains("DataSaubStat.test1_result.csv")) + .Where(r => r.Contains(pathResult)) .FirstOrDefault(); if (String.IsNullOrEmpty(resourceName)) @@ -87,6 +84,7 @@ public class DataSaubStatDtillingQualityServiceTest csv.Context.RegisterClassMap(); var expected = csv.GetRecords().ToList(); + //assert Assert.Equal(expected.Count(), actual.Count()); var expectedItem = expected.FirstOrDefault()!; diff --git a/AsbCloudInfrastructure/Services/SAUB/TelemetryDataEditorService.cs b/AsbCloudInfrastructure/Services/SAUB/TelemetryDataEditorService.cs index 27280426..7848e1ec 100644 --- a/AsbCloudInfrastructure/Services/SAUB/TelemetryDataEditorService.cs +++ b/AsbCloudInfrastructure/Services/SAUB/TelemetryDataEditorService.cs @@ -37,6 +37,7 @@ public class TelemetryDataEditorService : ITelemetryDataEditorService ITelemetryDataSaubService dataSaubService, ITelemetryDataService dataSpinService, IDataSaubStatRepository dataSaubStatRepository, + IDataSaubStatRepository dataSaubStatDrillingQualityRepository, IMessageRepository messageRepository, IDrillTestRepository drillTestRepository, ILimitingParameterRepository limitingParameterRepository, @@ -55,6 +56,7 @@ public class TelemetryDataEditorService : ITelemetryDataEditorService dataSaubService, dataSpinService, dataSaubStatRepository, + dataSaubStatDrillingQualityRepository, messageRepository, drillTestRepository, limitingParameterRepository,