Add support for a donation megaphone.

This commit is contained in:
Greyson Parrelli
2020-11-18 10:33:46 -05:00
committed by GitHub
parent 6e5abc92a0
commit 5c3baca055
7 changed files with 76 additions and 17 deletions

View File

@@ -2,8 +2,6 @@ package org.thoughtcrime.securesms.util;
import androidx.annotation.NonNull;
import com.google.protobuf.Empty;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -19,7 +17,7 @@ import java.util.Map;
import static org.junit.Assert.*;
@RunWith(Parameterized.class)
public class ResearchMegaphoneTest_determineCountEnabled {
public class PopulationFeatureFlagsTest_determineCountEnabled {
private final String phoneNumber;
private final Map<String, Integer> countryCounts;
@@ -68,9 +66,9 @@ public class ResearchMegaphoneTest_determineCountEnabled {
Log.initialize(new EmptyLogger());
}
public ResearchMegaphoneTest_determineCountEnabled(@NonNull String phoneNumber,
@NonNull Map<String, Integer> countryCounts,
long output)
public PopulationFeatureFlagsTest_determineCountEnabled(@NonNull String phoneNumber,
@NonNull Map<String, Integer> countryCounts,
long output)
{
this.phoneNumber = phoneNumber;
this.countryCounts = countryCounts;
@@ -79,7 +77,7 @@ public class ResearchMegaphoneTest_determineCountEnabled {
@Test
public void determineCountEnabled() {
assertEquals(output, ResearchMegaphone.determineCountEnabled(countryCounts, phoneNumber));
assertEquals(output, PopulationFeatureFlags.determineCountEnabled(countryCounts, phoneNumber));
}
}

View File

@@ -12,7 +12,7 @@ import java.util.Map;
import static org.junit.Assert.assertEquals;
@RunWith(Parameterized.class)
public class ResearchMegaphoneTest_parseCountryCounts {
public class PopulationFeatureFlagsTest_parseCountryCounts {
private final String input;
private final Map<String, Integer> output;
@@ -46,14 +46,14 @@ public class ResearchMegaphoneTest_parseCountryCounts {
});
}
public ResearchMegaphoneTest_parseCountryCounts(String input, Map<String, Integer> output) {
public PopulationFeatureFlagsTest_parseCountryCounts(String input, Map<String, Integer> output) {
this.input = input;
this.output = output;
}
@Test
public void parseCountryCounts() {
assertEquals(output, ResearchMegaphone.parseCountryCounts(input));
assertEquals(output, PopulationFeatureFlags.parseCountryCounts(input));
}
}