From 6e34f5f4c6a692412e882601e23d2b07b16f94d0 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Thu, 18 Apr 2024 10:06:46 +0500 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=BF=D0=B8=D1=81=D0=B0=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=B0=D0=B2=D1=82=D0=BE=D1=82=D0=B5=D1=81=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WellCompositeOperationServiceTest.cs | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/AsbCloudWebApi.Tests/Services/WellCompositeOperation/WellCompositeOperationServiceTest.cs b/AsbCloudWebApi.Tests/Services/WellCompositeOperation/WellCompositeOperationServiceTest.cs index 14224abd..271e9c7e 100644 --- a/AsbCloudWebApi.Tests/Services/WellCompositeOperation/WellCompositeOperationServiceTest.cs +++ b/AsbCloudWebApi.Tests/Services/WellCompositeOperation/WellCompositeOperationServiceTest.cs @@ -26,9 +26,7 @@ namespace AsbCloudWebApi.Tests.Services.WellCompositeOperation = Substitute.For(); private IWellService wellService = Substitute.For(); - - - + private List idsWells; private readonly static IEnumerable operationCategories = new List() { new(){Id = 5096, Name = "Шаблонирование перед спуском"}, @@ -47,6 +45,12 @@ namespace AsbCloudWebApi.Tests.Services.WellCompositeOperation new() {Id = 31, Caption = "Техническая колонна", Order = 2} }; + private readonly static IEnumerable wells = new List() + { + new() {Id = 55, Caption = "Скважина с ключом 55"}, + new() {Id = 64, Caption = "Скважина с ключом 64"}, + }; + private readonly static IEnumerable wellOperations1 = new List() { new() @@ -162,6 +166,11 @@ namespace AsbCloudWebApi.Tests.Services.WellCompositeOperation wellOperationCategoryRepository.Get(Arg.Any()) .Returns(operationCategories); + idsWells = new List() { 55, 64 }; + + wellService.GetAsync(Arg.Any(), Arg.Any()) + .Returns(wells); + service = new WellCompositeOperationService( wellSectionTypeRepository, wellOperationCategoryRepository, @@ -182,10 +191,8 @@ namespace AsbCloudWebApi.Tests.Services.WellCompositeOperation wellOperationRepository.GetAsync(Arg.Any(), Arg.Any()) .Returns(wellOperations1); - var idsWell = new List() { 55, 64 }; - // act - var result = await service.GetAsync(idsWell, CancellationToken.None); + var result = await service.GetAsync(idsWells, CancellationToken.None); // assert var compositeWellOperations = result.WellOperationsComposite; @@ -211,10 +218,8 @@ namespace AsbCloudWebApi.Tests.Services.WellCompositeOperation wellOperationRepository.GetAsync(Arg.Any(), Arg.Any()) .Returns(wellOperations2); - var idsWell = new List() { 55, 64 }; - // act - var result = await service.GetAsync(idsWell, CancellationToken.None); + var result = await service.GetAsync(idsWells, CancellationToken.None); // assert var compositeWellOperations = result.WellOperationsComposite; @@ -237,10 +242,8 @@ namespace AsbCloudWebApi.Tests.Services.WellCompositeOperation wellOperationRepository.GetAsync(Arg.Any(), Arg.Any()) .Returns(wellOperations3); - var idsWell = new List() { 55, 64 }; - // act - var result = await service.GetAsync(idsWell, CancellationToken.None); + var result = await service.GetAsync(idsWells, CancellationToken.None); // assert var compositeWellOperations = result.WellOperationsComposite; @@ -265,10 +268,8 @@ namespace AsbCloudWebApi.Tests.Services.WellCompositeOperation wellOperationRepository.GetAsync(Arg.Any(), Arg.Any()) .Returns(wellOperations4); - var idsWell = new List() { 55, 64 }; - // act - var result = await service.GetAsync(idsWell, CancellationToken.None); + var result = await service.GetAsync(idsWells, CancellationToken.None); // assert var compositeWellOperations = result.WellOperationsComposite; @@ -297,10 +298,8 @@ namespace AsbCloudWebApi.Tests.Services.WellCompositeOperation wellOperationRepository.GetAsync(Arg.Any(), Arg.Any()) .Returns(wellOperations); - var idsWell = new List() { 55, 64 }; - // act - var result = await service.GetAsync(idsWell, CancellationToken.None); + var result = await service.GetAsync(idsWells, CancellationToken.None); // assert var wellOperationsCount = result.WellCompositeSourceOperations