2024-11-18 14:22:09 +05:00
|
|
|
|
using Persistence.Database.Model;
|
|
|
|
|
using Persistence.Repository.Data;
|
2024-11-14 15:17:43 +05:00
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace Persistence.IntegrationTests.Controllers;
|
2024-11-18 14:22:09 +05:00
|
|
|
|
public class DataSaubControllerTest : TimeSeriesBaseControllerTest<DataSaub, DataSaubDto>
|
2024-11-14 15:17:43 +05:00
|
|
|
|
{
|
|
|
|
|
private readonly DataSaubDto dto = new DataSaubDto()
|
|
|
|
|
{
|
2024-11-18 14:22:09 +05:00
|
|
|
|
AxialLoad = 1,
|
|
|
|
|
BitDepth = 2,
|
|
|
|
|
BlockPosition = 3,
|
|
|
|
|
BlockSpeed = 4,
|
|
|
|
|
Date = DateTimeOffset.Now,
|
|
|
|
|
Flow = 5,
|
|
|
|
|
HookWeight = 6,
|
|
|
|
|
Id = 7,
|
|
|
|
|
IdFeedRegulator = 8,
|
|
|
|
|
Mode = 9,
|
|
|
|
|
Mse = 10,
|
|
|
|
|
MseState = 11,
|
|
|
|
|
Pressure = 12,
|
|
|
|
|
Pump0Flow = 13,
|
|
|
|
|
Pump1Flow = 14,
|
|
|
|
|
Pump2Flow = 15,
|
|
|
|
|
RotorSpeed = 16,
|
|
|
|
|
RotorTorque = 17,
|
|
|
|
|
User = string.Empty,
|
|
|
|
|
WellDepth = 18,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
private readonly DataSaub entity = new DataSaub()
|
|
|
|
|
{
|
|
|
|
|
AxialLoad = 1,
|
|
|
|
|
BitDepth = 2,
|
|
|
|
|
BlockPosition = 3,
|
|
|
|
|
BlockSpeed = 4,
|
|
|
|
|
Date = DateTimeOffset.UtcNow,
|
|
|
|
|
Flow = 5,
|
|
|
|
|
HookWeight = 6,
|
|
|
|
|
Id = 7,
|
|
|
|
|
IdFeedRegulator = 8,
|
|
|
|
|
Mode = 9,
|
|
|
|
|
Mse = 10,
|
|
|
|
|
MseState = 11,
|
|
|
|
|
Pressure = 12,
|
|
|
|
|
Pump0Flow = 13,
|
|
|
|
|
Pump1Flow = 14,
|
|
|
|
|
Pump2Flow = 15,
|
|
|
|
|
RotorSpeed = 16,
|
|
|
|
|
RotorTorque = 17,
|
|
|
|
|
User = string.Empty,
|
|
|
|
|
WellDepth = 18,
|
2024-11-14 15:17:43 +05:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public DataSaubControllerTest(WebAppFactoryFixture factory) : base(factory)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public async Task InsertRange_returns_success()
|
|
|
|
|
{
|
|
|
|
|
await InsertRangeSuccess(dto);
|
|
|
|
|
}
|
2024-11-18 14:22:09 +05:00
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public async Task Get_returns_success()
|
|
|
|
|
{
|
|
|
|
|
var beginDate = DateTimeOffset.UtcNow.AddDays(-1);
|
|
|
|
|
var endDate = DateTimeOffset.UtcNow;
|
|
|
|
|
await GetSuccess(beginDate, endDate, entity);
|
|
|
|
|
}
|
2024-11-14 15:17:43 +05:00
|
|
|
|
}
|