예제 #1
0
 public function testGetsAllResourceTypes()
 {
     $rows = new ResourceTypeRow();
     $rows->With(1, 'resourcetype1', 'description')->With(2, 'resourcetype2', null)->With(3, 'resourcetype3', '');
     $this->db->SetRows($rows->Rows());
     $types = $this->repository->GetResourceTypes();
     $this->assertEquals(3, count($types));
     $this->assertEquals(1, $types[0]->Id());
     $this->assertEquals('resourcetype1', $types[0]->Name());
     $this->assertEquals('description', $types[0]->Description());
     $expectedCommand = new GetAllResourceTypesCommand();
     $this->assertEquals($expectedCommand, $this->db->_LastCommand);
 }