Skip to content

Commit 8ed3730

Browse files
committed
checkin
1 parent 240a74c commit 8ed3730

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

DotNet/DataAcquisition.Domain/Application/Queries/QueryPlanQueries.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,6 @@ private Expression<Func<T, object>> SetSortBy<T>(string? sortBy)
135135

136136
public Task<bool> ExistsAsync(string facilityId, Frequency value, CancellationToken cancellationToken)
137137
{
138-
return _dbContext.QueryPlans.AnyAsync(q => q.FacilityId == facilityId && q.Type == value);
138+
return _dbContext.QueryPlans.AnyAsync(q => q.FacilityId == facilityId && q.Type == value, cancellationToken);
139139
}
140140
}

DotNet/ServiceTests/UnitTests/DataAcquisition/Controllers/QueryPlanConfigControllerTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ public async Task UpdateQueryPlanTest()
8787
{
8888
var facilityId = "test-facility-id";
8989
var _mocker = new AutoMocker();
90+
_mocker.GetMock<IQueryPlanQueries>().Setup(x => x.ExistsAsync(It.IsAny<string>(), Frequency.Monthly, CancellationToken.None))
91+
.ReturnsAsync(true);
9092
_mocker.GetMock<IQueryPlanQueries>().Setup(x => x.GetAsync(It.IsAny<string>(), Frequency.Monthly, CancellationToken.None))
9193
.ReturnsAsync(new QueryPlanModel());
9294
_mocker.GetMock<IQueryPlanManager>().Setup(x => x.UpdateAsync(It.IsAny<UpdateQueryPlanModel>(), CancellationToken.None))
@@ -135,8 +137,8 @@ public async Task DeleteQueryPlanTest()
135137
_mocker.GetMock<IQueryPlanManager>().Setup(x => x.AddAsync(It.IsAny<CreateQueryPlanModel>(), CancellationToken.None))
136138
.ReturnsAsync(queryPlan);
137139

138-
_mocker.GetMock<IQueryPlanQueries>().Setup(x => x.GetAsync(It.IsAny<string>(), Frequency.Monthly, CancellationToken.None))
139-
.ReturnsAsync(queryPlan);
140+
_mocker.GetMock<IQueryPlanQueries>().Setup(x => x.ExistsAsync(It.IsAny<string>(), Frequency.Monthly, CancellationToken.None))
141+
.ReturnsAsync(true);
140142

141143
var _createController = _mocker.CreateInstance<QueryPlanConfigController>();
142144

0 commit comments

Comments
 (0)