Skip to content

Commit

Permalink
Updated unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
NidhiDixit09 committed Sep 24, 2024
1 parent 0ccfb96 commit eb6dc7e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Branch-TestBed/Branch-SDK-Tests/BNCServerRequestQueueTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ - (id)unarchiveObjectFromData:(NSData *)data;
- (NSData *)oldArchiveQueue:(NSArray<BNCServerRequest *> *)queue;

+ (NSURL * _Nonnull) URLForQueueFile;
- (void)retrieve;

@end

Expand Down Expand Up @@ -173,11 +174,12 @@ - (void)testMultipleRequests {
decodedQueue = [_queue unarchiveQueueFromData:data];
}
XCTAssert([decodedQueue count] == 2);

[_queue remove:eventObject];
[_queue remove:openObject];
[_queue persistImmediately];
// Request Queue is empty. So there should not be any queue file on disk.
[_queue clearQueue];
XCTAssert([_queue queueDepth] == 0);
[_queue retrieve];
XCTAssert([_queue queueDepth] == 2);

// Request are loaded. So there should not be any queue file on disk.
XCTAssert([NSFileManager.defaultManager fileExistsAtPath:[[BNCServerRequestQueue URLForQueueFile] path]] == NO);
}

Expand Down

0 comments on commit eb6dc7e

Please sign in to comment.