use of android.telephony.CellSignalStrengthNr in project android_frameworks_opt_telephony by LineageOS.
the class CellSignalStrengthNrTest method testGetMethodWithHal.
@Test
public void testGetMethodWithHal() {
// GIVEN an instance of NrSignalStrength with some positive values
NrSignalStrength nrSignalStrength = new NrSignalStrength();
nrSignalStrength.csiRsrp = -CSIRSRP;
nrSignalStrength.csiRsrq = -CSIRSRQ;
nrSignalStrength.csiSinr = CSISINR;
nrSignalStrength.ssRsrp = -SSRSRP;
nrSignalStrength.ssRsrq = -SSRSRQ;
nrSignalStrength.ssSinr = SSSINR;
// THEN the get method should return the correct value
CellSignalStrengthNr css = new CellSignalStrengthNr(nrSignalStrength);
assertThat(css.getCsiRsrp()).isEqualTo(CSIRSRP);
assertThat(css.getCsiRsrq()).isEqualTo(CSIRSRQ);
assertThat(css.getCsiSinr()).isEqualTo(CSISINR);
assertThat(css.getSsRsrp()).isEqualTo(SSRSRP);
assertThat(css.getSsRsrq()).isEqualTo(SSRSRQ);
assertThat(css.getSsSinr()).isEqualTo(SSSINR);
assertThat(css.getDbm()).isEqualTo(SSRSRP);
}
use of android.telephony.CellSignalStrengthNr in project android_frameworks_opt_telephony by LineageOS.
the class CellSignalStrengthNrTest method testAusLevel_validValue.
@Test
public void testAusLevel_validValue() {
// GIVEN an instance of CellSignalStrengthNr with valid csirsrp
CellSignalStrengthNr css = new CellSignalStrengthNr(CSIRSRP, CSIRSRQ, CSISINR, SSRSRP, SSRSRQ, SSSINR);
// THEN the asu level is in range [0, 97]
assertThat(css.getAsuLevel()).isIn(Range.range(0, BoundType.CLOSED, 97, BoundType.CLOSED));
}
use of android.telephony.CellSignalStrengthNr in project android_frameworks_opt_telephony by LineageOS.
the class CellSignalStrengthNrTest method testGetMethod.
@Test
public void testGetMethod() {
// GIVEN an instance of CellSignalStrengthNr
CellSignalStrengthNr css = new CellSignalStrengthNr(CSIRSRP, CSIRSRQ, CSISINR, SSRSRP, SSRSRQ, SSSINR);
// THEN the get method should return correct value
assertThat(css.getCsiRsrp()).isEqualTo(CSIRSRP);
assertThat(css.getCsiRsrq()).isEqualTo(CSIRSRQ);
assertThat(css.getCsiSinr()).isEqualTo(CSISINR);
assertThat(css.getSsRsrp()).isEqualTo(SSRSRP);
assertThat(css.getSsRsrq()).isEqualTo(SSRSRQ);
assertThat(css.getSsSinr()).isEqualTo(SSSINR);
assertThat(css.getDbm()).isEqualTo(SSRSRP);
}
use of android.telephony.CellSignalStrengthNr in project android_frameworks_opt_telephony by LineageOS.
the class CellSignalStrengthNrTest method testEquals_sameParameters.
@Test
public void testEquals_sameParameters() {
// GIVEN an instance of CellSignalStrengthNr and another object with the same parameters
CellSignalStrengthNr css = new CellSignalStrengthNr(CSIRSRP, CSIRSRQ, CSISINR, SSRSRP, SSRSRQ, SSSINR);
CellSignalStrengthNr anotherCss = new CellSignalStrengthNr(CSIRSRP, CSIRSRQ, CSISINR, SSRSRP, SSRSRQ, SSSINR);
// THEN this two objects are equivalent
assertThat(css).isEqualTo(anotherCss);
}
use of android.telephony.CellSignalStrengthNr in project android_frameworks_opt_telephony by LineageOS.
the class CellSignalStrengthNrTest method testSignalLevel_validValue.
@Test
public void testSignalLevel_validValue() {
for (int ssRsrp = -140; ssRsrp <= -44; ssRsrp++) {
// GIVEN an instance of CellSignalStrengthNr with valid csirsrp
CellSignalStrengthNr css = new CellSignalStrengthNr(CSIRSRP, CSIRSRQ, CSISINR, ssRsrp, SSRSRQ, SSSINR);
// THEN the signal level is valid
assertThat(css.getLevel()).isIn(Range.range(CellSignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN, BoundType.CLOSED, CellSignalStrength.SIGNAL_STRENGTH_GREAT, BoundType.CLOSED));
}
}
Aggregations