From f44adbd6dcac45643483a4771720e42523bc926c Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Fri, 5 Oct 2018 13:58:17 +0300 Subject: [PATCH] Update custom properties tests --- .../appcenter/CustomPropertiesTest.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sdk/appcenter/src/test/java/com/microsoft/appcenter/CustomPropertiesTest.java b/sdk/appcenter/src/test/java/com/microsoft/appcenter/CustomPropertiesTest.java index bb04996525..4928ab5d98 100644 --- a/sdk/appcenter/src/test/java/com/microsoft/appcenter/CustomPropertiesTest.java +++ b/sdk/appcenter/src/test/java/com/microsoft/appcenter/CustomPropertiesTest.java @@ -178,11 +178,26 @@ public void setNumber() { verifyStatic(times(1)); AppCenterLog.error(eq(AppCenter.LOG_TAG), anyString()); + + /* Invalid values. */ + properties.set(key, Double.NaN); + assertEquals(0, properties.getProperties().size()); + verifyStatic(times(2)); + AppCenterLog.error(eq(AppCenter.LOG_TAG), anyString()); + properties.set(key, Double.POSITIVE_INFINITY); + assertEquals(0, properties.getProperties().size()); + verifyStatic(times(3)); + AppCenterLog.error(eq(AppCenter.LOG_TAG), anyString()); + properties.set(key, Double.NEGATIVE_INFINITY); + assertEquals(0, properties.getProperties().size()); + verifyStatic(times(4)); + AppCenterLog.error(eq(AppCenter.LOG_TAG), anyString()); + /* Normal value. */ Number normalValue = 0; properties.set(key, normalValue); assertEquals(1, properties.getProperties().size()); - verifyStatic(times(1)); + verifyStatic(times(4)); AppCenterLog.error(eq(AppCenter.LOG_TAG), anyString()); }