use of com.microsoft.appcenter.ingestion.models.properties.TypedProperty in project mobile-center-sdk-android by Microsoft.
the class CommonSchemaDataUtilsAndroidTest method unknownTypedProperty.
@Test
public void unknownTypedProperty() {
MockCommonSchemaLog log = new MockCommonSchemaLog();
TypedProperty typedProperty = new TypedProperty() {
@Override
public String getType() {
return "unknown";
}
};
typedProperty.setName("a");
CommonSchemaDataUtils.addCommonSchemaData(Collections.singletonList(typedProperty), log);
/* Data is empty because the invalid property filtered out. */
assertEquals(0, log.getData().getProperties().length());
/* And we don't send metadata when using only standard types. */
assertNull(log.getExt());
}
use of com.microsoft.appcenter.ingestion.models.properties.TypedProperty in project mobile-center-sdk-android by Microsoft.
the class CommonSchemaDataUtilsAndroidTest method invalidBaseType.
@Test
public void invalidBaseType() {
/* When using invalid base type. */
MockCommonSchemaLog log = new MockCommonSchemaLog();
log.setExt(new Extensions());
List<TypedProperty> properties = new ArrayList<>();
LongTypedProperty a = new LongTypedProperty();
a.setName("baseType");
a.setValue(1);
properties.add(a);
CommonSchemaDataUtils.addCommonSchemaData(properties, log);
/* Check data and metadata is missing type. */
assertEquals(0, log.getData().getProperties().length());
assertNull(log.getExt().getMetadata());
}
Aggregations