/**
  * @covers WindowsAzure\ServiceManagement\Models\UpgradeDeploymentOptions::setRoleToUpgrade
  * @covers WindowsAzure\ServiceManagement\Models\UpgradeDeploymentOptions::getRoleToUpgrade
  */
 public function testSetRoleToUpgrade()
 {
     // Setup
     $expected = 'myrole';
     $options = new UpgradeDeploymentOptions();
     // Test
     $options->setRoleToUpgrade($expected);
     // Assert
     $this->assertEquals($expected, $options->getRoleToUpgrade());
 }
 /**
  * @covers WindowsAzure\ServiceManagement\ServiceManagementRestProxy::walkUpgradeDomain
  * @covers WindowsAzure\ServiceManagement\ServiceManagementRestProxy::_getDeploymentPath
  * @covers WindowsAzure\ServiceManagement\ServiceManagementRestProxy::_getPath
  * @covers WindowsAzure\ServiceManagement\ServiceManagementRestProxy::_createRequestXml
  * @covers WindowsAzure\ServiceManagement\Models\AsynchronousOperationResult::create
  * @group Deployment
  */
 public function testWalkUpgradeDomain()
 {
     // Setup
     $name = $this->getTestName();
     $this->createDeployment($name);
     $mode = Mode::MANUAL;
     $configuration = $this->complexConfiguration;
     $packageUrl = TestResources::complexPackageUrl();
     $label = base64_encode($name . 'upgraded');
     $force = true;
     $options = new UpgradeDeploymentOptions();
     $options->setDeploymentName($name);
     $expectedInstancesCount = 4;
     $result = $this->restProxy->upgradeDeployment($name, $mode, $packageUrl, $configuration, $label, $force, $options);
     // Block until the upgrade is done.
     $this->blockUntilAsyncSucceed($result);
     // Test
     $result = $this->restProxy->walkUpgradeDomain($name, 0, $options);
     // Block until the walk upgrade is done.
     $this->blockUntilAsyncSucceed($result);
     // Assert
     $options = new GetDeploymentOptions();
     $options->setSlot(DeploymentSlot::PRODUCTION);
     $result = $this->restProxy->getDeployment($name, $options);
     $deployment = $result->getDeployment();
     $this->assertCount($expectedInstancesCount, $deployment->getRoleInstanceList());
 }