Skip to content

Commit 0023c13

Browse files
committed
Update RestApiTestBase to accommodate locationHeader for PUT (Insert) and make more methods virtual for manual skipping.
1 parent a68c923 commit 0023c13

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

DataGateway.Service.Tests/SqlTests/RestApiTestBase.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ await SetupAndRunRestApiTest(
316316
/// with a REST POST request.
317317
/// </summary>
318318
[TestMethod]
319-
public async Task InsertOneInCompositeKeyTableTest()
319+
public virtual async Task InsertOneInCompositeKeyTableTest()
320320
{
321321
string requestBody = @"
322322
{
@@ -400,15 +400,18 @@ public virtual async Task PutOne_Insert_Test()
400400
""issueNumber"": 1234
401401
}";
402402

403+
string expectedLocationHeader = $"/id/{STARTING_ID_FOR_TEST_INSERTS}";
404+
403405
await SetupAndRunRestApiTest(
404-
primaryKeyRoute: "id/1",
406+
primaryKeyRoute: $"id/{STARTING_ID_FOR_TEST_INSERTS}",
405407
queryString: null,
406408
entity: _integration_NonAutoGenPK_TableName,
407409
sqlQuery: GetQuery(nameof(PutOne_Insert_Test)),
408410
controller: _restController,
409411
operationType: Operation.Upsert,
410412
requestBody: requestBody,
411-
expectedStatusCode: 201
413+
expectedStatusCode: 201,
414+
expectedLocationHeader: expectedLocationHeader
412415
);
413416
}
414417

0 commit comments

Comments
 (0)