Test stubs.
This commit is contained in:
parent
c18effd893
commit
6d437b4afa
|
@ -54,6 +54,8 @@ public class SourceXdripPlugin extends PluginBase implements BgSourceInterface {
|
|||
String sourceDescription = bundle.getString(Intents.XDRIP_DATA_SOURCE_DESCRIPTION, "");
|
||||
bgReading.filtered = sourceDescription.equals("G5 Native");
|
||||
if (MainApp.engineeringMode && !bgReading.filtered && bgReading.noise >= 0 && bgReading.noise <= 4) {
|
||||
// TODO syncing noice with NS is neither implemented nor tested
|
||||
// * NSUpload.uploadBg
|
||||
log.debug("Setting filtered=true, since noise is provided and passed check: " + bgReading.noise);
|
||||
bgReading.filtered = true;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ public class SourceXdripPluginTest {
|
|||
}
|
||||
|
||||
// TODO
|
||||
@Ignore("Bundle needs to be properly mocked")
|
||||
@Ignore("Bundle needs to be properly mocked or Robolectrics issues with SQLite resolved")
|
||||
@Test
|
||||
public void bgWithUnknownSourceIsMarkedUnfiltered() {
|
||||
Bundle bundle = createBroadcastBundle();
|
||||
|
@ -53,7 +53,7 @@ public class SourceXdripPluginTest {
|
|||
}
|
||||
|
||||
// TODO
|
||||
@Ignore("Bundle needs to be properly mocked")
|
||||
@Ignore("Bundle needs to be properly mocked or Robolectrics issues with SQLite resolved")
|
||||
@Test
|
||||
public void bgWithSourceG5NativeIsMarkedFiltered() {
|
||||
Bundle bundle = createBroadcastBundle();
|
||||
|
@ -63,6 +63,28 @@ public class SourceXdripPluginTest {
|
|||
assertTrue(bgReadings.filtered);
|
||||
}
|
||||
|
||||
// TODO
|
||||
@Ignore("Bundle needs to be properly mocked or Robolectrics issues with SQLite resolved")
|
||||
@Test
|
||||
public void bgWithWithGoodNoiseIsMarkedFiltered() {
|
||||
Bundle bundle = createBroadcastBundle();
|
||||
bundle.putString(Intents.EXTRA_NOISE, "1.0");
|
||||
|
||||
BgReading bgReadings = plugin.processNewData(bundle).get(0);
|
||||
assertTrue(bgReadings.filtered);
|
||||
}
|
||||
|
||||
// TODO
|
||||
@Ignore("Bundle needs to be properly mocked or Robolectrics issues with SQLite resolved")
|
||||
@Test
|
||||
public void bgWithWithExcessiveNoiseDataIsMarkedFiltered() {
|
||||
Bundle bundle = createBroadcastBundle();
|
||||
bundle.putString(Intents.EXTRA_NOISE, "80.0");
|
||||
|
||||
BgReading bgReadings = plugin.processNewData(bundle).get(0);
|
||||
assertTrue(bgReadings.filtered);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private Bundle createBroadcastBundle() {
|
||||
Bundle bundle = new Bundle();
|
||||
|
|
Loading…
Reference in a new issue