Esempio n. 1
0
 /**
  * @covers MicrosoftAzure\Storage\Table\Models\Query::addSelectField
  * @covers MicrosoftAzure\Storage\Table\Models\Query::getSelectFields
  */
 public function testAddSelectField()
 {
     // Setup
     $query = new Query();
     $field = 'customerId';
     $expected = array($field);
     // Test
     $query->addSelectField($field);
     // Assert
     $this->assertEquals($expected, $query->getSelectFields());
 }
 public function testCheckQuery()
 {
     $query = new Query();
     $this->assertNull($query->getFilter(), 'Default Query->getFilter');
     $this->assertNull($query->getSelectFields(), 'Default Query->getSelectFields');
     $this->assertNull($query->getTop(), 'Default Query->getTop');
     $query->addSelectField('bar');
     $query->addSelectField('baz');
     $this->assertNotNull($query->getSelectFields(), 'Add Query->getSelectFields');
     $this->assertEquals(2, count($query->getSelectFields()), 'Add Query->getSelectFields->size');
     $filter = Filter::applyConstant('foo', EdmType::STRING);
     $query->setFilter($filter);
     $query->setSelectFields(null);
     $query->setTop(TableServiceFunctionalTestData::INT_MAX_VALUE);
     $this->assertEquals($filter, $query->getFilter(), 'Set Query->getFilter');
     $this->assertNull($query->getSelectFields(), 'Set Query->getSelectFields');
     $this->assertEquals(TableServiceFunctionalTestData::INT_MAX_VALUE, $query->getTop(), 'Set Query->getTop');
 }