Skip to content

Commit

Permalink
Add test for embedded phishing dataset updates
Browse files Browse the repository at this point in the history
  • Loading branch information
not-a-rootkit committed Oct 22, 2024
1 parent 8c43f96 commit 1549f59
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Tests/PhishingDetectionTests/PhishingDetectionDataStoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,22 @@ class PhishingDetectionDataStoreTests: XCTestCase {
XCTAssertEqual(actualFilterSet, expectedFilerSet)
XCTAssertEqual(actualHashPrefix, expectedHashPrefix)
}

Check failure on line 63 in Tests/PhishingDetectionTests/PhishingDetectionDataStoreTests.swift

View workflow job for this annotation

GitHub Actions / Run SwiftLint

Lines should not have trailing whitespace (trailing_whitespace)
func testWhenEmbeddedRevisionNewerThanOnDisk_ThenLoadEmbedded() async {
mockDataProvider.embeddedRevision = 5
let expectedFilerSet = Set([Filter(hashValue: "some", regex: "some")])
let expectedHashPrefix = Set(["sassa"])
mockDataProvider.shouldReturnFilterSet(set: expectedFilerSet)
mockDataProvider.shouldReturnHashPrefixes(set: expectedHashPrefix)

Check failure on line 70 in Tests/PhishingDetectionTests/PhishingDetectionDataStoreTests.swift

View workflow job for this annotation

GitHub Actions / Run SwiftLint

Lines should not have trailing whitespace (trailing_whitespace)
let actualRevision = dataStore.currentRevision
let actualFilterSet = dataStore.filterSet
let actualHashPrefix = dataStore.hashPrefixes

XCTAssertEqual(actualFilterSet, expectedFilerSet)
XCTAssertEqual(actualHashPrefix, expectedHashPrefix)
XCTAssertEqual(actualRevision, 5)
}

func testWriteAndLoadData() async {
// Get and write data
Expand Down

0 comments on commit 1549f59

Please sign in to comment.