Search in sources :

Example 31 with Pair

use of com.microsoft.azure.sdk.iot.service.devicetwin.Pair in project azure-iot-sdk-java by Azure.

the class PairTest method constructorCreatesNewPair.

/*
    **Tests_SRS_Pair_25_001: [**The constructor shall save the key and value representing this Pair.**]**
     */
@Test
public void constructorCreatesNewPair() {
    //act
    Pair testPair = new Pair("TestKey", "TestObject");
    //assert
    assertNotNull(testPair);
    assertTrue(testPair.getKey().equals("TestKey"));
    assertTrue(testPair.getValue().equals("TestObject"));
}
Also used : Pair(com.microsoft.azure.sdk.iot.service.devicetwin.Pair) Test(org.junit.Test)

Example 32 with Pair

use of com.microsoft.azure.sdk.iot.service.devicetwin.Pair in project azure-iot-sdk-java by Azure.

the class PairTest method setValueSets.

/*
    **Tests_SRS_Pair_25_006: [**The function shall overwrite the new value for old and return old value.**]**
     */
@Test
public void setValueSets() {
    //arrange
    Pair testPair = new Pair("TestKey", "TestObject");
    //act
    testPair.setValue("newTestObject");
    //assert
    Object value = testPair.getValue();
    assertNotNull(testPair);
    assertTrue(value.equals("newTestObject"));
}
Also used : Pair(com.microsoft.azure.sdk.iot.service.devicetwin.Pair) Test(org.junit.Test)

Aggregations

Pair (com.microsoft.azure.sdk.iot.service.devicetwin.Pair)32 Test (org.junit.Test)23 DeviceTwinDevice (com.microsoft.azure.sdk.iot.service.devicetwin.DeviceTwinDevice)20 HashSet (java.util.HashSet)10 HashMap (java.util.HashMap)5 Property (com.microsoft.azure.sdk.iot.device.DeviceTwin.Property)3 DeviceTwin (com.microsoft.azure.sdk.iot.service.devicetwin.DeviceTwin)1 IotHubException (com.microsoft.azure.sdk.iot.service.exceptions.IotHubException)1 Random (java.util.Random)1 ExecutorService (java.util.concurrent.ExecutorService)1 DeviceConnectionString (tests.integration.com.microsoft.azure.sdk.iot.device.DeviceConnectionString)1