using Mapster; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Persistence.IntegrationTests.Clients; using Persistence.Models; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; using System.Threading.Tasks; using Xunit; namespace Persistence.IntegrationTests.Controllers; public abstract class TimeSeriesBaseControllerTest : BaseIntegrationTest where TDto : class, new() { private ITimeSeriesClient client; public TimeSeriesBaseControllerTest(WebAppFactoryFixture factory) : base(factory) { //dbContext.CleanupDbSet(); client = factory.GetHttpClient>(string.Empty); } public async Task InsertRangeSuccess(TDto dto) { //arrange var expected = dto.Adapt(); //act var response = await client.InsertRangeAsync(new TDto[] { expected }); //assert Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Equal(1, response.Content); //var entity = GetByWellId(); //Assert.NotNull(entity); //var actual = entity.Adapt>(); //Assert.Equal(ProcessMapPlanBase.IdStateActual, actual.IdState); //var excludeProps = new[] { // nameof(ProcessMapPlanBaseDto.Id), // nameof(ProcessMapPlanBaseDto.Section) //}; //MatchHelper.Match(expected, actual.Item, excludeProps); } }