0 Replies Latest reply on Dec 9, 2015 9:04 AM by roberttay RSS
    roberttay Apprentice

    InfoTable.isEmpty() returns true even if getRowCount() > 0

    I'm writing some unit tests for a custom extension in ThingWorx 6.5.4.

    In my test i create and populate a ValueCollection and add it to a new InfoTable (created using its default constructor).

    When i run my test and verify that the table is not empty, it fails.

    InfoTable table = new InfoTable();

    ValueCollection row = new ValueCollection();

    table.addRow(row);

    Assert.assertTrue(table.isEmpty());

    Assert.assertTrue(table.getRowCount() > 0);

     

    This test passes and i don't understand why.

     

    Javadocs for InfoTable imply that isEmpty():

    isEmpty()

    Returns a boolean indicating whether this InfoTable has a size of zero

     

    This makes no sense to me.

    What am i missing?