forked from ddrilling/AsbCloudServer
Автотесты (правки)
This commit is contained in:
parent
f6e638f8db
commit
3337112be2
@ -1,4 +1,5 @@
|
|||||||
using AsbCloudApp.Data;
|
using AsbCloudApp.Data;
|
||||||
|
using AsbCloudDb.Model;
|
||||||
using AsbCloudWebApi.IntegrationTests.Clients;
|
using AsbCloudWebApi.IntegrationTests.Clients;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
@ -96,14 +97,15 @@ public class WellOperationControllerTest : BaseIntegrationTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Успешное добавление операций (с предварительной очисткой данных)
|
/// Успешное добавление операций (без предварительной очистки данных)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task InsertRange_returns_success()
|
public async Task InsertRange_returns_success()
|
||||||
{
|
{
|
||||||
|
dbContext.CleanupDbSet<WellOperation>();
|
||||||
//act
|
//act
|
||||||
var response = await wellOperationClient.InsertRangeAsync(idWell, 1, true, dtos);
|
var response = await wellOperationClient.InsertRangeAsync(idWell, 1, false, dtos);
|
||||||
|
|
||||||
//assert
|
//assert
|
||||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
@ -111,14 +113,14 @@ public class WellOperationControllerTest : BaseIntegrationTest
|
|||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Неуспешное добавление операций (с предварительной очисткой данных)
|
/// Неуспешное добавление операций (без предварительной очистки данных)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task InsertRange_returns_error()
|
public async Task InsertRange_returns_error()
|
||||||
{
|
{
|
||||||
//act
|
//act
|
||||||
var response = await wellOperationClient.InsertRangeAsync(idWell, 1, true, dtosWithError);
|
var response = await wellOperationClient.InsertRangeAsync(idWell, 1, false, dtosWithError);
|
||||||
|
|
||||||
//assert
|
//assert
|
||||||
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
|
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
|
||||||
@ -132,7 +134,7 @@ public class WellOperationControllerTest : BaseIntegrationTest
|
|||||||
public async Task InsertRangeWithDeleteBefore_returns_success()
|
public async Task InsertRangeWithDeleteBefore_returns_success()
|
||||||
{
|
{
|
||||||
//act
|
//act
|
||||||
var response = await wellOperationClient.InsertRangeAsync(idWell, 1, false, dtos);
|
var response = await wellOperationClient.InsertRangeAsync(idWell, 1, true, dtos);
|
||||||
|
|
||||||
//assert
|
//assert
|
||||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
@ -146,7 +148,7 @@ public class WellOperationControllerTest : BaseIntegrationTest
|
|||||||
public async Task InsertRangeWithDeleteBefore_returns_error()
|
public async Task InsertRangeWithDeleteBefore_returns_error()
|
||||||
{
|
{
|
||||||
//act
|
//act
|
||||||
var response = await wellOperationClient.InsertRangeAsync(idWell, 1, false, dtosWithError);
|
var response = await wellOperationClient.InsertRangeAsync(idWell, 1, true, dtosWithError);
|
||||||
|
|
||||||
//assert
|
//assert
|
||||||
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
|
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
|
||||||
|
Loading…
Reference in New Issue
Block a user