Search in sources :

Example 1 with Tools

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

the class ToolsTest method isNullOrWhiteSpace_input_white_space.

// Tests_SRS_SERVICE_SDK_JAVA_TOOLS_12_005: [The function shall call the isNullOrEmpty function and return with it’s return value]
@Test
public void isNullOrWhiteSpace_input_white_space() {
    // Arrange
    String value = " ";
    Boolean expResult = true;
    new Expectations() {

        Tools tools;

        {
            tools.isNullOrEmpty(anyString);
        }
    };
    // Act
    Boolean result = Tools.isNullOrWhiteSpace(value);
    // Assert
    assertEquals(expResult, result);
}
Also used : Expectations(mockit.Expectations) Tools(com.microsoft.azure.sdk.iot.service.Tools) JsonString(javax.json.JsonString) Test(org.junit.Test)

Example 2 with Tools

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

the class ToolsTest method isNullOrWhiteSpace_input_white_spaces.

// Tests_SRS_SERVICE_SDK_JAVA_TOOLS_12_005: [The function shall call the isNullOrEmpty function and return with it’s return value]
@Test
public void isNullOrWhiteSpace_input_white_spaces() {
    // Arrange
    String value = "   ";
    Boolean expResult = true;
    new Expectations() {

        Tools tools;

        {
            tools.isNullOrEmpty(anyString);
        }
    };
    // Act
    Boolean result = Tools.isNullOrWhiteSpace(value);
    // Assert
    assertEquals(expResult, result);
}
Also used : Expectations(mockit.Expectations) Tools(com.microsoft.azure.sdk.iot.service.Tools) JsonString(javax.json.JsonString) Test(org.junit.Test)

Example 3 with Tools

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

the class ToolsTest method isNullOrWhiteSpace_not_empty.

// Tests_SRS_SERVICE_SDK_JAVA_TOOLS_12_005: [The function shall call the isNullOrEmpty function and return with it’s return value]
@Test
public void isNullOrWhiteSpace_not_empty() {
    // Arrange
    String value = "XXX";
    Boolean expResult = false;
    new Expectations() {

        Tools tools;

        {
            tools.isNullOrEmpty(anyString);
        }
    };
    // Act
    Boolean result = Tools.isNullOrWhiteSpace(value);
    // Assert
    assertEquals(expResult, result);
}
Also used : Expectations(mockit.Expectations) Tools(com.microsoft.azure.sdk.iot.service.Tools) JsonString(javax.json.JsonString) Test(org.junit.Test)

Aggregations

Tools (com.microsoft.azure.sdk.iot.service.Tools)3 JsonString (javax.json.JsonString)3 Expectations (mockit.Expectations)3 Test (org.junit.Test)3