You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ContentBlockerProtectionStoreTests has some unused code.
First, we have an unnecessary import from the DuckDuckGo module.
Second, on line 39, there's a call to FileStore that is not needed for what is being tested. try FileStore().persist(configFile, for: .privacyConfiguration)
If we remove this line, we can also remove the throws keyword from the test.
We also have some asserts that I didn't see the need to add since they do not influence what is being tested.
Line 42: XCTAssertEqual(privacyConfigurationManager.embeddedConfigData.etag, AppPrivacyConfigurationDataProvider.Constants.embeddedDataETag)
Line 47: XCTAssertNotNil(newConfig)
This one in particular, if we force the unwrap here, we don't need this check and the if let bellow this line. I don't see a problem in forcing the unwrap here since we are unit testing and are sure we are providing the correct dependencies.
If we move some parts of this code to separate functions, we can make this test more readable and organized in the structure GIVEN WHEN THEN.
The text was updated successfully, but these errors were encountered:
ContentBlockerProtectionStoreTests has some unused code.
First, we have an unnecessary import from the
DuckDuckGo
module.Second, on line 39, there's a call to FileStore that is not needed for what is being tested.
try FileStore().persist(configFile, for: .privacyConfiguration)
If we remove this line, we can also remove the
throws
keyword from the test.We also have some asserts that I didn't see the need to add since they do not influence what is being tested.
Line 42:
XCTAssertEqual(privacyConfigurationManager.embeddedConfigData.etag, AppPrivacyConfigurationDataProvider.Constants.embeddedDataETag)
Line 47:
XCTAssertNotNil(newConfig)
This one in particular, if we force the unwrap here, we don't need this check and the if let bellow this line. I don't see a problem in forcing the unwrap here since we are unit testing and are sure we are providing the correct dependencies.
If we move some parts of this code to separate functions, we can make this test more readable and organized in the structure GIVEN WHEN THEN.
The text was updated successfully, but these errors were encountered: