Skip to content

Commit

Permalink
Add commit produced by llama3-a6990e
Browse files Browse the repository at this point in the history
  • Loading branch information
drawers committed May 21, 2024
1 parent 5b7db89 commit 84ad6df
Show file tree
Hide file tree
Showing 517 changed files with 4,452 additions and 4,431 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ class AdClickAttributionPluginTest {
}

@Test
fun whenFeatureNameDoesNotMatchAdClickAttributionThenReturnFalse() {
fun `store - feature name does not match ad click attribution - returns false`() {
AdClickFeatureName.values().filter { it != FEATURE_NAME }.forEach {
assertFalse(testee.store(it.value, EMPTY_JSON_STRING))
}
}

@Test
fun whenFeatureNameMatchesAdClickAttributionThenReturnTrue() {
fun `store - feature name matches ad click attribution - returns true`() {
assertTrue(testee.store(FEATURE_NAME_VALUE, EMPTY_JSON_STRING))
}

@Test
fun whenFeatureNameMatchesAdClickAttributionAndIsEnabledThenStoreFeatureEnabled() {
fun `store - feature name matches ad click attribution and is enabled - store feature enabled`() {
val jsonString = FileUtilities.loadText(javaClass.classLoader!!, "json/ad_click_attribution.json")

testee.store(FEATURE_NAME_VALUE, jsonString)
Expand All @@ -71,7 +71,7 @@ class AdClickAttributionPluginTest {
}

@Test
fun whenFeatureNameMatchesAdClickAttributionAndIsNotEnabledThenStoreFeatureDisabled() {
fun `store - feature name matches ad click attribution and is not enabled - store feature disabled`() {
val jsonString = FileUtilities.loadText(javaClass.classLoader!!, "json/ad_click_attribution_disabled.json")

testee.store(FEATURE_NAME_VALUE, jsonString)
Expand All @@ -80,7 +80,7 @@ class AdClickAttributionPluginTest {
}

@Test
fun whenFeatureNameMatchesAdClickAttributionThenUpdateAllExistingLists() {
fun `whenFeatureNameMatchesAdClickAttributionThenUpdateAllExistingLists - update all existing lists`() {
val jsonString = FileUtilities.loadText(javaClass.classLoader!!, "json/ad_click_attribution.json")

testee.store(FEATURE_NAME_VALUE, jsonString)
Expand Down Expand Up @@ -124,7 +124,7 @@ class AdClickAttributionPluginTest {
}

@Test
fun whenFeatureNameMatchesAdClickAttributionAndHasMinSupportedVersionThenStoreMinSupportedVersion() {
fun `store - feature name matches ad click attribution and has min supported version - store min supported version`() {
val jsonString = FileUtilities.loadText(javaClass.classLoader!!, "json/ad_click_attribution_min_supported_version.json")

testee.store(FEATURE_NAME_VALUE, jsonString)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class AdClickFeatureTogglesPluginTest {
}

@Test
fun whenIsEnabledCalledOnAdCLickFeatureNameThenReturnRepositoryValue() {
fun `isEnabled - repository value`() {
whenever(adClickFeatureToggleRepository.get(AdClickFeatureName.AdClickAttributionFeatureName, false)).thenReturn(true)
Assert.assertEquals(true, plugin.isEnabled(AdClickFeatureName.AdClickAttributionFeatureName.value, false))

Expand All @@ -47,12 +47,12 @@ class AdClickFeatureTogglesPluginTest {
}

@Test
fun whenIsEnabledCalledOnOtherFeatureNameThenReturnRepositoryNull() {
fun `isEnabled - other feature name - return repository null`() {
Assert.assertNull(plugin.isEnabled(TestFeatureName().value, false))
}

@Test
fun whenIsEnabledAndFeatureIsAdCLickeatureThenReturnTrueWhenEnabled() =
fun `isEnabled - ad click feature enabled - returns true when enabled`() =
runTest {
givenAdCLickFeatureIsEnabled()

Expand All @@ -62,7 +62,7 @@ class AdClickFeatureTogglesPluginTest {
}

@Test
fun whenIsEnabledAndFeatureIsAdCLickFeatureThenReturnFalseWhenDisabled() =
fun `isEnabled - ad click feature disabled - returns false`() =
runTest {
givenAdCLickFeatureIsDisabled()

Expand All @@ -72,7 +72,7 @@ class AdClickFeatureTogglesPluginTest {
}

@Test
fun whenIsEnabledAndFeatureIsAdCLickFeatureThenReturnDefaultValueIfFeatureDoesNotExist() =
fun `isEnabled - ad click feature does not exist - returns default value`() =
runTest {
val defaultValue = true
givenAdCLickFeatureReturnsDefaultValue(defaultValue)
Expand All @@ -84,7 +84,7 @@ class AdClickFeatureTogglesPluginTest {
}

@Test
fun whenIsEnabledAndFeatureIsAdCLickFeatureAndAppVersionEqualToMinSupportedVersionThenReturnTrueWhenEnabled() =
fun `isEnabled - Ad click feature enabled and app version equal to min supported version - returns true when enabled`() =
runTest {
givenAdCLickFeatureIsEnabled()
givenAppVersionIsEqualToMinSupportedVersion()
Expand All @@ -95,7 +95,7 @@ class AdClickFeatureTogglesPluginTest {
}

@Test
fun whenIsEnabledAndFeatureIsAdCLickFeatureAndAppVersionIsGreaterThanMinSupportedVersionThenReturnTrueWhenEnabled() =
fun `isEnabled - Ad click feature enabled and app version greater than min supported version - returns true when enabled`() =
runTest {
givenAdCLickFeatureIsEnabled()
givenAppVersionIsGreaterThanMinSupportedVersion()
Expand All @@ -106,7 +106,7 @@ class AdClickFeatureTogglesPluginTest {
}

@Test
fun whenIsEnabledAndFeatureIsAdCLickFeatureAndAppVersionIsSmallerThanMinSupportedVersionThenReturnFalseWhenEnabled() =
fun `isEnabled - Ad click feature enabled and app version smaller than min supported version - returns false when enabled`() =
runTest {
givenAdCLickFeatureIsEnabled()
givenAppVersionIsSmallerThanMinSupportedVersion()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class DataRemovalAdClickWorkerTest {
}

@Test
fun whenDoWorkThenCallClearAllExpiredAsyncAndReturnSuccess() =
fun `doWork - clear all expired async - success`() =
runTest {
val worker = TestListenableWorkerBuilder<DataRemovalAdClickWorker>(context = context).build()
worker.adClickManager = mockAdClickManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ class DuckDuckGoAdClickDataTest {
}

@Test
fun whenSetAdDomainForActiveTabCalledThenTheSameDomainIsRetrieved() {
fun `setAdDomainForActiveTab - same domain retrieved`() {
testee.setAdDomainTldPlusOne("host")

assertEquals("host", testee.getAdDomainTldPlusOne())
}

@Test
fun whenRemoveAdDomainForActiveTabCalledThenAdDomainForTabIsRemoved() {
fun `removeAdDomain - ad domain for tab removed`() {
testee.setAdDomainTldPlusOne("host")
assertEquals("host", testee.getAdDomainTldPlusOne())

Expand All @@ -50,7 +50,7 @@ class DuckDuckGoAdClickDataTest {
}

@Test
fun whenRemoveExemptionForActiveTabCalledThenAllExemptionForTabAreRemoved() {
fun `removeExemption - all exemptions removed`() {
testee.addExemption(dummyExpiration("host1"))
assertTrue(testee.isHostExempted("host1"))

Expand All @@ -60,7 +60,7 @@ class DuckDuckGoAdClickDataTest {
}

@Test
fun whenAddExemptionForActiveTabCalledForADifferentHostThenOnlyThatSecondHostExemptionExists() {
fun `addExemption - different host - only that second host exemption exists`() {
val host = "host1"
val otherHost = "host2"
testee.addExemption(dummyExpiration(host))
Expand Down
Loading

0 comments on commit 84ad6df

Please sign in to comment.