update:2021.03.19
fix:重新提交 add:
This commit is contained in:
1 parent
d4399ffa61
commit
d23777e680
1191 files changed
+149106
No files matched your search
@@ -0,0 +1,36 @@
|
||||
package com.android.uiuios.config;
|
||||
|
||||
import com.android.uiuios.config.FlagOverrideRule.FlagOverride;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* Sample Robolectric test that demonstrates flag-overriding.
|
||||
*/
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class FlagOverrideSampleTest {
|
||||
|
||||
// Check out https://junit.org/junit4/javadoc/4.12/org/junit/Rule.html for more information
|
||||
// on @Rules.
|
||||
@Rule
|
||||
public final FlagOverrideRule flags = new FlagOverrideRule();
|
||||
|
||||
@FlagOverride(key = "EXAMPLE_FLAG", value = true)
|
||||
@Test
|
||||
public void withFlagOn() {
|
||||
assertTrue(FeatureFlags.EXAMPLE_FLAG.get());
|
||||
}
|
||||
|
||||
|
||||
@FlagOverride(key = "EXAMPLE_FLAG", value = false)
|
||||
@Test
|
||||
public void withFlagOff() {
|
||||
assertFalse(FeatureFlags.EXAMPLE_FLAG.get());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user