Setpoint API #1
@ -49,7 +49,7 @@ namespace Persistence.IntegrationTests.Controllers
|
|||||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
Assert.NotNull(response.Content);
|
Assert.NotNull(response.Content);
|
||||||
Assert.NotEmpty(response.Content);
|
Assert.NotEmpty(response.Content);
|
||||||
Assert.Equal(response.Content.FirstOrDefault()?.Key, setpointKey);
|
Assert.Equal(setpointKey, response.Content.FirstOrDefault()?.Key);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@ -87,7 +87,7 @@ namespace Persistence.IntegrationTests.Controllers
|
|||||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
Assert.NotNull(response.Content);
|
Assert.NotNull(response.Content);
|
||||||
Assert.NotEmpty(response.Content);
|
Assert.NotEmpty(response.Content);
|
||||||
Assert.Equal(response.Content.FirstOrDefault()?.Key, setpointKey);
|
Assert.Equal(setpointKey, response.Content.FirstOrDefault()?.Key);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@ -122,7 +122,7 @@ namespace Persistence.IntegrationTests.Controllers
|
|||||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
Assert.NotNull(response.Content);
|
Assert.NotNull(response.Content);
|
||||||
Assert.NotEmpty(response.Content);
|
Assert.NotEmpty(response.Content);
|
||||||
Assert.Equal(response.Content.FirstOrDefault().Value.FirstOrDefault()?.Key, setpointKey);
|
Assert.Equal(setpointKey, response.Content.FirstOrDefault()?.Key);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
@ -35,6 +35,7 @@ namespace Persistence.Repository.Repositories
|
|||||||
.ToArrayAsync(token);
|
.ToArrayAsync(token);
|
||||||
var filteredEntities = entities
|
var filteredEntities = entities
|
||||||
.GroupBy(e => e.Key)
|
.GroupBy(e => e.Key)
|
||||||
|
.Select(e => e.OrderBy(o => o.Created))
|
||||||
.Select(e => e.Where(e => e.Created <= historyMoment).Last());
|
.Select(e => e.Where(e => e.Created <= historyMoment).Last());
|
||||||
var dtos = filteredEntities
|
var dtos = filteredEntities
|
||||||
.Select(e => e.Adapt<SetpointValueDto>());
|
.Select(e => e.Adapt<SetpointValueDto>());
|
||||||
|
Loading…
Reference in New Issue
Block a user