use of com.microsoft.azure.sdk.iot.service.devicetwin.MethodResult in project azure-iot-sdk-java by Azure.
the class MethodResultTest method constructorCreatesNewMethodResult_NullStatus.
@Test
public void constructorCreatesNewMethodResult_NullStatus() {
//act
MethodResult methodResult = new MethodResult(null, "TestObject");
//assert
assertNotNull(methodResult);
assertNull(methodResult.getStatus());
assertThat(methodResult.getPayload().toString(), is("TestObject"));
}
use of com.microsoft.azure.sdk.iot.service.devicetwin.MethodResult in project azure-iot-sdk-java by Azure.
the class MethodResultTest method constructorCreatesNewMethodResult.
/* Tests_SRS_METHODRESULT_21_001: [The constructor shall save the status and payload representing the method invoke result.] */
/* Tests_SRS_METHODRESULT_21_002: [There is no restrictions for these values, it can be empty, or null.] */
/* Tests_SRS_METHODRESULT_21_003: [The getStatus shall return the status stored by the constructor.] */
/* Tests_SRS_METHODRESULT_21_004: [The getPayload shall return the payload stored by the constructor.] */
@Test
public void constructorCreatesNewMethodResult() {
//act
MethodResult methodResult = new MethodResult(123, "TestObject");
//assert
assertNotNull(methodResult);
assertThat(methodResult.getStatus(), is(123));
assertThat(methodResult.getPayload().toString(), is("TestObject"));
}
Aggregations