@@ -54,7 +54,7 @@ class PostRepositoryPostsListTests: CoreDataTestCase {
5454 XCTAssertEqual ( total, 15 )
5555
5656 // Perform search
57- let postIDs : [ TaggedManagedObjectID < Post > ] = try await repository. search ( input: " 1 " , statuses: [ . publish] , limit: 1 , orderBy: . byDate, descending: true , in: blogID)
57+ let postIDs : [ TaggedManagedObjectID < Post > ] = try await repository. search ( input: " 1 " , statuses: [ . publish] , tag : nil , offset : 0 , limit: 1 , orderBy: . byDate, descending: true , in: blogID)
5858 XCTAssertEqual ( postIDs. count, 1 )
5959
6060 // There should still be 15 posts after the search: no local posts should be deleted
@@ -82,20 +82,20 @@ extension PostRepositoryPostsListTests {
8282 func testPostsListStubReturnPostsAsRequested( ) async throws {
8383 try await preparePostsList ( type: " post " , total: 20 )
8484
85- var result = try await repository. search ( type: Post . self, input: nil , statuses: [ ] , limit: 10 , orderBy: . byDate, descending: true , in: blogID)
85+ var result = try await repository. search ( type: Post . self, input: nil , statuses: [ ] , tag : nil , offset : 0 , limit: 10 , orderBy: . byDate, descending: true , in: blogID)
8686 XCTAssertEqual ( result. count, 10 )
8787
88- result = try await repository. search ( type: Post . self, input: nil , statuses: [ ] , limit: 20 , orderBy: . byDate, descending: true , in: blogID)
88+ result = try await repository. search ( type: Post . self, input: nil , statuses: [ ] , tag : nil , offset : 0 , limit: 20 , orderBy: . byDate, descending: true , in: blogID)
8989 XCTAssertEqual ( result. count, 20 )
9090
91- result = try await repository. search ( type: Post . self, input: nil , statuses: [ ] , limit: 30 , orderBy: . byDate, descending: true , in: blogID)
91+ result = try await repository. search ( type: Post . self, input: nil , statuses: [ ] , tag : nil , offset : 0 , limit: 30 , orderBy: . byDate, descending: true , in: blogID)
9292 XCTAssertEqual ( result. count, 20 )
9393 }
9494
9595 func testPostsListStubReturnPostsAtCorrectPosition( ) async throws {
9696 try await preparePostsList ( type: " post " , total: 20 )
9797
98- let all = try await repository. search ( type: Post . self, input: nil , statuses: [ ] , limit: 30 , orderBy: . byDate, descending: true , in: blogID)
98+ let all = try await repository. search ( type: Post . self, input: nil , statuses: [ ] , tag : nil , offset : 0 , limit: 30 , orderBy: . byDate, descending: true , in: blogID)
9999
100100 var result = try await repository. paginate ( type: Post . self, statuses: [ ] , offset: 0 , number: 5 , in: blogID)
101101 XCTAssertEqual ( result, Array ( all [ 0 ..< 5 ] ) )
@@ -107,19 +107,19 @@ extension PostRepositoryPostsListTests {
107107 func testPostsListStubReturnPostsSearch( ) async throws {
108108 try await preparePostsList ( type: " post " , total: 10 )
109109
110- let all = try await repository. search ( type: Post . self, input: nil , statuses: [ ] , limit: 30 , orderBy: . byDate, descending: true , in: blogID)
110+ let all = try await repository. search ( type: Post . self, input: nil , statuses: [ ] , tag : nil , offset : 0 , limit: 30 , orderBy: . byDate, descending: true , in: blogID)
111111
112- var result = try await repository. search ( type: Post . self, input: " 1 " , statuses: [ ] , limit: 1 , orderBy: . byDate, descending: true , in: blogID)
112+ var result = try await repository. search ( type: Post . self, input: " 1 " , statuses: [ ] , tag : nil , offset : 0 , limit: 1 , orderBy: . byDate, descending: true , in: blogID)
113113 XCTAssertEqual ( result, [ all [ 0 ] ] )
114114
115- result = try await repository. search ( type: Post . self, input: " 2 " , statuses: [ ] , limit: 1 , orderBy: . byDate, descending: true , in: blogID)
115+ result = try await repository. search ( type: Post . self, input: " 2 " , statuses: [ ] , tag : nil , offset : 0 , limit: 1 , orderBy: . byDate, descending: true , in: blogID)
116116 XCTAssertEqual ( result, [ all [ 1 ] ] )
117117 }
118118
119119 func testPostsListStubReturnDefaultNumberOfPosts( ) async throws {
120120 try await preparePostsList ( type: " post " , total: 100 )
121121
122- let result = try await repository. search ( type: Post . self, input: nil , statuses: [ ] , limit: 0 , orderBy: . byDate, descending: true , in: blogID)
122+ let result = try await repository. search ( type: Post . self, input: nil , statuses: [ ] , tag : nil , offset : 0 , limit: 0 , orderBy: . byDate, descending: true , in: blogID)
123123 XCTAssertEqual ( result. count, 20 )
124124 }
125125
0 commit comments