From 3337112be254023bf570564e8e6c107d2f9f47a0 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Fri, 26 Jan 2024 09:49:00 +0500 Subject: [PATCH] =?UTF-8?q?=D0=90=D0=B2=D1=82=D0=BE=D1=82=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D1=8B=20(=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/WellOperationControllerTest.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/AsbCloudWebApi.IntegrationTests/Controllers/WellOperationControllerTest.cs b/AsbCloudWebApi.IntegrationTests/Controllers/WellOperationControllerTest.cs index 809ccf1d..3ac32e40 100644 --- a/AsbCloudWebApi.IntegrationTests/Controllers/WellOperationControllerTest.cs +++ b/AsbCloudWebApi.IntegrationTests/Controllers/WellOperationControllerTest.cs @@ -1,4 +1,5 @@ using AsbCloudApp.Data; +using AsbCloudDb.Model; using AsbCloudWebApi.IntegrationTests.Clients; using System.Net; using Xunit; @@ -96,14 +97,15 @@ public class WellOperationControllerTest : BaseIntegrationTest } /// - /// Успешное добавление операций (с предварительной очисткой данных) + /// Успешное добавление операций (без предварительной очистки данных) /// /// [Fact] public async Task InsertRange_returns_success() { + dbContext.CleanupDbSet(); //act - var response = await wellOperationClient.InsertRangeAsync(idWell, 1, true, dtos); + var response = await wellOperationClient.InsertRangeAsync(idWell, 1, false, dtos); //assert Assert.Equal(HttpStatusCode.OK, response.StatusCode); @@ -111,14 +113,14 @@ public class WellOperationControllerTest : BaseIntegrationTest /// - /// Неуспешное добавление операций (с предварительной очисткой данных) + /// Неуспешное добавление операций (без предварительной очистки данных) /// /// [Fact] public async Task InsertRange_returns_error() { //act - var response = await wellOperationClient.InsertRangeAsync(idWell, 1, true, dtosWithError); + var response = await wellOperationClient.InsertRangeAsync(idWell, 1, false, dtosWithError); //assert Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); @@ -132,7 +134,7 @@ public class WellOperationControllerTest : BaseIntegrationTest public async Task InsertRangeWithDeleteBefore_returns_success() { //act - var response = await wellOperationClient.InsertRangeAsync(idWell, 1, false, dtos); + var response = await wellOperationClient.InsertRangeAsync(idWell, 1, true, dtos); //assert Assert.Equal(HttpStatusCode.OK, response.StatusCode); @@ -146,7 +148,7 @@ public class WellOperationControllerTest : BaseIntegrationTest public async Task InsertRangeWithDeleteBefore_returns_error() { //act - var response = await wellOperationClient.InsertRangeAsync(idWell, 1, false, dtosWithError); + var response = await wellOperationClient.InsertRangeAsync(idWell, 1, true, dtosWithError); //assert Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);