Search in sources :

Example 11 with BooleanTypedProperty

use of com.microsoft.appcenter.ingestion.models.properties.BooleanTypedProperty in project mobile-center-sdk-android by Microsoft.

the class CommonSchemaDataUtilsAndroidTest method booleanTypedProperty.

@Test
public void booleanTypedProperty() throws JSONException {
    MockCommonSchemaLog log = new MockCommonSchemaLog();
    List<TypedProperty> properties = new ArrayList<>();
    BooleanTypedProperty property = new BooleanTypedProperty();
    property.setName("a");
    property.setValue(true);
    properties.add(property);
    CommonSchemaDataUtils.addCommonSchemaData(properties, log);
    assertEquals(1, log.getData().getProperties().length());
    assertTrue(log.getData().getProperties().getBoolean("a"));
}
Also used : BooleanTypedProperty(com.microsoft.appcenter.ingestion.models.properties.BooleanTypedProperty) ArrayList(java.util.ArrayList) DoubleTypedProperty(com.microsoft.appcenter.ingestion.models.properties.DoubleTypedProperty) LongTypedProperty(com.microsoft.appcenter.ingestion.models.properties.LongTypedProperty) BooleanTypedProperty(com.microsoft.appcenter.ingestion.models.properties.BooleanTypedProperty) StringTypedProperty(com.microsoft.appcenter.ingestion.models.properties.StringTypedProperty) TypedProperty(com.microsoft.appcenter.ingestion.models.properties.TypedProperty) DateTimeTypedProperty(com.microsoft.appcenter.ingestion.models.properties.DateTimeTypedProperty) Test(org.junit.Test)

Aggregations

BooleanTypedProperty (com.microsoft.appcenter.ingestion.models.properties.BooleanTypedProperty)11 DateTimeTypedProperty (com.microsoft.appcenter.ingestion.models.properties.DateTimeTypedProperty)7 DoubleTypedProperty (com.microsoft.appcenter.ingestion.models.properties.DoubleTypedProperty)7 LongTypedProperty (com.microsoft.appcenter.ingestion.models.properties.LongTypedProperty)7 StringTypedProperty (com.microsoft.appcenter.ingestion.models.properties.StringTypedProperty)7 Test (org.junit.Test)7 TypedProperty (com.microsoft.appcenter.ingestion.models.properties.TypedProperty)4 ArrayList (java.util.ArrayList)4 Date (java.util.Date)3 EventLog (com.microsoft.appcenter.analytics.ingestion.models.EventLog)2 TestUtils.generateString (com.microsoft.appcenter.test.TestUtils.generateString)2 JSONObject (org.json.JSONObject)2 Context (android.content.Context)1 PageLog (com.microsoft.appcenter.analytics.ingestion.models.PageLog)1 StartSessionLog (com.microsoft.appcenter.analytics.ingestion.models.StartSessionLog)1 EventLogFactory (com.microsoft.appcenter.analytics.ingestion.models.json.EventLogFactory)1 PageLogFactory (com.microsoft.appcenter.analytics.ingestion.models.json.PageLogFactory)1 StartSessionLogFactory (com.microsoft.appcenter.analytics.ingestion.models.json.StartSessionLogFactory)1 CommonSchemaEventLog (com.microsoft.appcenter.analytics.ingestion.models.one.CommonSchemaEventLog)1 Channel (com.microsoft.appcenter.channel.Channel)1