/**
  * @covers WindowsAzure\ServiceManagement\Models\GetHostedServicePropertiesResult::getHostedService 
  * @covers WindowsAzure\ServiceManagement\Models\GetHostedServicePropertiesResult::setHostedService 
  */
 public function testGetHostedService()
 {
     // Setup
     $hostedService = new HostedService();
     $result = new GetHostedServicePropertiesResult();
     // Test
     $result->setHostedService($hostedService);
     // Assert
     $this->assertEquals($hostedService, $result->getHostedService());
 }
Пример #2
0
 /**
  * Retrieves system properties for the specified hosted service. These properties
  * include the service name and service type; the name of the affinity group to
  * which the service belongs, or its location if it is not part of an affinity
  * group; and optionally, information on the service's deployments.
  *
  * @param string                            $name    The name for the hosted
  * service.
  * @param GetHostedServicePropertiesOptions $options The optional parameters.
  *
  * @return GetHostedServicePropertiesResult
  *
  * @see http://msdn.microsoft.com/en-us/library/windowsazure/ee460806.aspx
  */
 public function getHostedServiceProperties($name, $options = null)
 {
     Validate::isString($name, 'name');
     Validate::notNullOrEmpty($name, 'name');
     if (is_null($options)) {
         $options = new GetHostedServicePropertiesOptions();
     }
     $context = new HttpCallContext();
     $context->setMethod(Resources::HTTP_GET);
     $context->setPath($this->_getHostedServicePath($name));
     $context->addStatusCode(Resources::STATUS_OK);
     $context->addQueryParameter(Resources::QP_EMBED_DETAIL, Utilities::booleanToString($options->getEmbedDetail()));
     $response = $this->sendContext($context);
     $parsed = $this->dataSerializer->unserialize($response->getBody());
     return GetHostedServicePropertiesResult::create($parsed);
 }