@@ -147,7 +147,7 @@ public async Task Run_NoExceptionIdQueryParameter_ReturnsAllExceptions()
147147 _httpParserHelperMock . Setup ( s => s . GetQueryParameterAsInt ( _requestMock . Object , "lastId" , 0 ) ) . Returns ( 0 ) ;
148148 _validationDataMock . Setup ( s => s . GetAllFilteredExceptions ( ExceptionStatus . All , SortOrder . Descending , _exceptionCategory ) ) . ReturnsAsync ( _exceptionList ) ;
149149 _paginationServiceMock . Setup ( p => p . GetPaginatedResult ( It . IsAny < IQueryable < ValidationException > > ( ) , null , It . IsAny < Func < ValidationException , int > > ( ) ) ) . Returns ( paginatedResult ) ;
150- _paginationServiceMock . Setup ( p => p . BuildPaginationHeaders ( _requestMock . Object , paginatedResult ) ) . Returns ( expectedHeaders ) ;
150+ _paginationServiceMock . Setup ( p => p . AddNavigationHeaders ( _requestMock . Object , paginatedResult ) ) . Returns ( expectedHeaders ) ;
151151
152152 // Act
153153 var result = await _service . Run ( _requestMock . Object ) ;
@@ -160,7 +160,7 @@ public async Task Run_NoExceptionIdQueryParameter_ReturnsAllExceptions()
160160 _requestMock . Object ,
161161 It . IsAny < string > ( ) ,
162162 expectedHeaders ) , Times . Once ) ;
163- _paginationServiceMock . Verify ( p => p . BuildPaginationHeaders ( _requestMock . Object , paginatedResult ) , Times . Once ) ;
163+ _paginationServiceMock . Verify ( p => p . AddNavigationHeaders ( _requestMock . Object , paginatedResult ) , Times . Once ) ;
164164 }
165165
166166 [ TestMethod ]
@@ -279,7 +279,7 @@ public async Task Run_WithExceptionStatus_ReturnsFilteredExceptions()
279279 _httpParserHelperMock . Setup ( s => s . GetQueryParameterAsInt ( _requestMock . Object , "lastId" , 0 ) ) . Returns ( 0 ) ;
280280 _validationDataMock . Setup ( s => s . GetAllFilteredExceptions ( exceptionStatus , SortOrder . Descending , _exceptionCategory ) ) . ReturnsAsync ( _exceptionList ) ;
281281 _paginationServiceMock . Setup ( p => p . GetPaginatedResult ( It . IsAny < IQueryable < ValidationException > > ( ) , null , It . IsAny < Func < ValidationException , int > > ( ) ) ) . Returns ( paginatedResult ) ;
282- _paginationServiceMock . Setup ( p => p . BuildPaginationHeaders ( _requestMock . Object , paginatedResult ) ) . Returns ( expectedHeaders ) ;
282+ _paginationServiceMock . Setup ( p => p . AddNavigationHeaders ( _requestMock . Object , paginatedResult ) ) . Returns ( expectedHeaders ) ;
283283
284284 // Act
285285 var result = await _service . Run ( _requestMock . Object ) ;
@@ -313,7 +313,7 @@ public async Task Run_WithSortOrder_ReturnsOrderedExceptions()
313313 _httpParserHelperMock . Setup ( s => s . GetQueryParameterAsInt ( _requestMock . Object , "lastId" , 0 ) ) . Returns ( 0 ) ;
314314 _validationDataMock . Setup ( s => s . GetAllFilteredExceptions ( ExceptionStatus . All , sortOrder , _exceptionCategory ) ) . ReturnsAsync ( _exceptionList ) ;
315315 _paginationServiceMock . Setup ( p => p . GetPaginatedResult ( It . IsAny < IQueryable < ValidationException > > ( ) , null , It . IsAny < Func < ValidationException , int > > ( ) ) ) . Returns ( paginatedResult ) ;
316- _paginationServiceMock . Setup ( p => p . BuildPaginationHeaders ( _requestMock . Object , paginatedResult ) ) . Returns ( expectedHeaders ) ;
316+ _paginationServiceMock . Setup ( p => p . AddNavigationHeaders ( _requestMock . Object , paginatedResult ) ) . Returns ( expectedHeaders ) ;
317317
318318 // Act
319319 var result = await _service . Run ( _requestMock . Object ) ;
@@ -348,7 +348,7 @@ public async Task Run_WithLastId_ReturnsPaginatedResults()
348348 _httpParserHelperMock . Setup ( s => s . GetQueryParameterAsInt ( _requestMock . Object , "lastId" , 0 ) ) . Returns ( lastId ) ;
349349 _validationDataMock . Setup ( s => s . GetAllFilteredExceptions ( ExceptionStatus . All , SortOrder . Descending , _exceptionCategory ) ) . ReturnsAsync ( _exceptionList ) ;
350350 _paginationServiceMock . Setup ( p => p . GetPaginatedResult ( It . IsAny < IQueryable < ValidationException > > ( ) , lastId , It . IsAny < Func < ValidationException , int > > ( ) ) ) . Returns ( paginatedResult ) ;
351- _paginationServiceMock . Setup ( p => p . BuildPaginationHeaders ( _requestMock . Object , paginatedResult ) ) . Returns ( expectedHeaders ) ;
351+ _paginationServiceMock . Setup ( p => p . AddNavigationHeaders ( _requestMock . Object , paginatedResult ) ) . Returns ( expectedHeaders ) ;
352352
353353 // Act
354354 var result = await _service . Run ( _requestMock . Object ) ;
@@ -420,7 +420,7 @@ public async Task Run_NegativeExceptionId_ReturnsAllExceptions()
420420 _httpParserHelperMock . Setup ( s => s . GetQueryParameterAsInt ( _requestMock . Object , "lastId" , 0 ) ) . Returns ( 0 ) ;
421421 _validationDataMock . Setup ( s => s . GetAllFilteredExceptions ( ExceptionStatus . All , SortOrder . Descending , _exceptionCategory ) ) . ReturnsAsync ( _exceptionList ) ;
422422 _paginationServiceMock . Setup ( p => p . GetPaginatedResult ( It . IsAny < IQueryable < ValidationException > > ( ) , null , It . IsAny < Func < ValidationException , int > > ( ) ) ) . Returns ( paginatedResult ) ;
423- _paginationServiceMock . Setup ( p => p . BuildPaginationHeaders ( _requestMock . Object , paginatedResult ) ) . Returns ( expectedHeaders ) ;
423+ _paginationServiceMock . Setup ( p => p . AddNavigationHeaders ( _requestMock . Object , paginatedResult ) ) . Returns ( expectedHeaders ) ;
424424
425425 // Act
426426 var result = await _service . Run ( _requestMock . Object ) ;
@@ -455,7 +455,7 @@ public async Task Run_ZeroLastId_PassesNullToPagination()
455455 _httpParserHelperMock . Setup ( s => s . GetQueryParameterAsInt ( _requestMock . Object , "lastId" , 0 ) ) . Returns ( 0 ) ;
456456 _validationDataMock . Setup ( s => s . GetAllFilteredExceptions ( ExceptionStatus . All , SortOrder . Descending , _exceptionCategory ) ) . ReturnsAsync ( _exceptionList ) ;
457457 _paginationServiceMock . Setup ( p => p . GetPaginatedResult ( It . IsAny < IQueryable < ValidationException > > ( ) , null , It . IsAny < Func < ValidationException , int > > ( ) ) ) . Returns ( paginatedResult ) ;
458- _paginationServiceMock . Setup ( p => p . BuildPaginationHeaders ( _requestMock . Object , paginatedResult ) ) . Returns ( expectedHeaders ) ;
458+ _paginationServiceMock . Setup ( p => p . AddNavigationHeaders ( _requestMock . Object , paginatedResult ) ) . Returns ( expectedHeaders ) ;
459459
460460 // Act
461461 var result = await _service . Run ( _requestMock . Object ) ;
@@ -490,7 +490,7 @@ public async Task Run_NonZeroLastId_PassesLastIdToPagination()
490490 _httpParserHelperMock . Setup ( s => s . GetQueryParameterAsInt ( _requestMock . Object , "lastId" , 0 ) ) . Returns ( lastId ) ;
491491 _validationDataMock . Setup ( s => s . GetAllFilteredExceptions ( ExceptionStatus . All , SortOrder . Descending , _exceptionCategory ) ) . ReturnsAsync ( _exceptionList ) ;
492492 _paginationServiceMock . Setup ( p => p . GetPaginatedResult ( It . IsAny < IQueryable < ValidationException > > ( ) , lastId , It . IsAny < Func < ValidationException , int > > ( ) ) ) . Returns ( paginatedResult ) ;
493- _paginationServiceMock . Setup ( p => p . BuildPaginationHeaders ( _requestMock . Object , paginatedResult ) ) . Returns ( expectedHeaders ) ;
493+ _paginationServiceMock . Setup ( p => p . AddNavigationHeaders ( _requestMock . Object , paginatedResult ) ) . Returns ( expectedHeaders ) ;
494494
495495 // Act
496496 var result = await _service . Run ( _requestMock . Object ) ;
@@ -524,7 +524,7 @@ public async Task Run_DefaultValuesUsed_WhenParametersNotProvided()
524524 _httpParserHelperMock . Setup ( s => s . GetQueryParameterAsInt ( _requestMock . Object , "lastId" , 0 ) ) . Returns ( 0 ) ;
525525 _validationDataMock . Setup ( s => s . GetAllFilteredExceptions ( ExceptionStatus . All , SortOrder . Descending , _exceptionCategory ) ) . ReturnsAsync ( _exceptionList ) ;
526526 _paginationServiceMock . Setup ( p => p . GetPaginatedResult ( It . IsAny < IQueryable < ValidationException > > ( ) , null , It . IsAny < Func < ValidationException , int > > ( ) ) ) . Returns ( paginatedResult ) ;
527- _paginationServiceMock . Setup ( p => p . BuildPaginationHeaders ( _requestMock . Object , paginatedResult ) ) . Returns ( expectedHeaders ) ;
527+ _paginationServiceMock . Setup ( p => p . AddNavigationHeaders ( _requestMock . Object , paginatedResult ) ) . Returns ( expectedHeaders ) ;
528528
529529 // Act
530530 var result = await _service . Run ( _requestMock . Object ) ;
@@ -564,7 +564,7 @@ public async Task Run_ReturnsResponseWithHeaders_WhenPaginatedResultHasItems()
564564 _httpParserHelperMock . Setup ( s => s . GetQueryParameterAsInt ( _requestMock . Object , "lastId" , 0 ) ) . Returns ( 0 ) ;
565565 _validationDataMock . Setup ( s => s . GetAllFilteredExceptions ( ExceptionStatus . All , SortOrder . Descending , _exceptionCategory ) ) . ReturnsAsync ( _exceptionList ) ;
566566 _paginationServiceMock . Setup ( p => p . GetPaginatedResult ( It . IsAny < IQueryable < ValidationException > > ( ) , null , It . IsAny < Func < ValidationException , int > > ( ) ) ) . Returns ( paginatedResult ) ;
567- _paginationServiceMock . Setup ( p => p . BuildPaginationHeaders ( _requestMock . Object , paginatedResult ) ) . Returns ( expectedHeaders ) ;
567+ _paginationServiceMock . Setup ( p => p . AddNavigationHeaders ( _requestMock . Object , paginatedResult ) ) . Returns ( expectedHeaders ) ;
568568
569569 // Act
570570 var result = await _service . Run ( _requestMock . Object ) ;
@@ -577,6 +577,6 @@ public async Task Run_ReturnsResponseWithHeaders_WhenPaginatedResultHasItems()
577577 _requestMock . Object ,
578578 It . IsAny < string > ( ) ,
579579 expectedHeaders ) , Times . Once ) ;
580- _paginationServiceMock . Verify ( p => p . BuildPaginationHeaders ( _requestMock . Object , paginatedResult ) , Times . Once ) ;
580+ _paginationServiceMock . Verify ( p => p . AddNavigationHeaders ( _requestMock . Object , paginatedResult ) , Times . Once ) ;
581581 }
582582}
0 commit comments