forked from ddrilling/AsbCloudServer
Автотесты (правки)
This commit is contained in:
parent
f6e638f8db
commit
3337112be2
@ -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
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Успешное добавление операций (с предварительной очисткой данных)
|
||||
/// Успешное добавление операций (без предварительной очистки данных)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Fact]
|
||||
public async Task InsertRange_returns_success()
|
||||
{
|
||||
dbContext.CleanupDbSet<WellOperation>();
|
||||
//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
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Неуспешное добавление операций (с предварительной очисткой данных)
|
||||
/// Неуспешное добавление операций (без предварительной очистки данных)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[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);
|
||||
|
Loading…
Reference in New Issue
Block a user