PageRenderTime 56ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 0ms

/tests/unit/WindowsAzure/ServiceBus/models/SubscriptionDescriptionTest.php

https://bitbucket.org/skudatech/azure-sdk-for-php
PHP | 255 lines | 101 code | 53 blank | 101 comment | 0 complexity | 6482ad48dff9f6b2f5d641f95f7e7008 MD5 | raw file
  1. <?php
  2. /**
  3. * LICENSE: Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. * http://www.apache.org/licenses/LICENSE-2.0
  7. *
  8. * Unless required by applicable law or agreed to in writing, software
  9. * distributed under the License is distributed on an "AS IS" BASIS,
  10. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. * See the License for the specific language governing permissions and
  12. * limitations under the License.
  13. *
  14. * PHP version 5
  15. *
  16. * @category Microsoft
  17. * @package Tests\Unit\WindowsAzure\ServiceBus\Models
  18. * @author Azure PHP SDK <azurephpsdk@microsoft.com>
  19. * @copyright 2012 Microsoft Corporation
  20. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  21. * @link https://github.com/WindowsAzure/azure-sdk-for-php
  22. */
  23. namespace Tests\Unit\WindowsAzure\ServiceBus\Models;
  24. use WindowsAzure\ServiceBus\Models\SubscriptionDescription;
  25. /**
  26. * Unit tests for class WrapAccessTokenResult
  27. *
  28. * @category Microsoft
  29. * @package Tests\Unit\WindowsAzure\ServiceBus\Models
  30. * @author Azure PHP SDK <azurephpsdk@microsoft.com>
  31. * @copyright 2012 Microsoft Corporation
  32. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  33. * @version Release: @package_version@
  34. * @link https://github.com/WindowsAzure/azure-sdk-for-php
  35. */
  36. class SubscriptionDescriptionTest extends \PHPUnit_Framework_TestCase
  37. {
  38. /**
  39. * @covers WindowsAzure\ServiceBus\Models\SubscriptionDescription::__construct
  40. */
  41. public function testSubscriptionDescriptionConstructor()
  42. {
  43. // Setup
  44. // Test
  45. $subscriptionDescription = new SubscriptionDescription();
  46. // Assert
  47. $this->assertNotNull($subscriptionDescription);
  48. }
  49. /**
  50. * @covers WindowsAzure\ServiceBus\Models\SubscriptionDescription::getLockDuration
  51. * @covers WindowsAzure\ServiceBus\Models\SubscriptionDescription::setLockDuration
  52. */
  53. public function testGetSetLockDuration() {
  54. // Setup
  55. $expected = 'testLockDuration';
  56. $subscriptionDescription = new SubscriptionDescription();
  57. // Test
  58. $subscriptionDescription->setLockDuration($expected);
  59. $actual = $subscriptionDescription->getLockDuration();
  60. // Assert
  61. $this->assertEquals(
  62. $expected,
  63. $actual
  64. );
  65. }
  66. /**
  67. * @covers WindowsAzure\ServiceBus\Models\SubscriptionDescription::getRequiresSession
  68. * @covers WindowsAzure\ServiceBus\Models\SubscriptionDescription::setRequiresSession
  69. */
  70. public function testGetSetRequiresSession() {
  71. // Setup
  72. $expected = 'testRequiresSession';
  73. $subscriptionDescription = new SubscriptionDescription();
  74. // Test
  75. $subscriptionDescription->setRequiresSession($expected);
  76. $actual = $subscriptionDescription->getRequiresSession();
  77. // Assert
  78. $this->assertEquals(
  79. $expected,
  80. $actual
  81. );
  82. }
  83. /**
  84. * @covers WindowsAzure\ServiceBus\Models\SubscriptionDescription::getDefaultMessageTimeToLive
  85. * @covers WindowsAzure\ServiceBus\Models\SubscriptionDescription::setDefaultMessageTimeToLive
  86. */
  87. public function testGetSetDefaultMessageTimeToLive() {
  88. // Setup
  89. $expected = 'testDefaultMessageTimeToLive';
  90. $subscriptionDescription = new SubscriptionDescription();
  91. // Test
  92. $subscriptionDescription->setDefaultMessageTimeToLive($expected);
  93. $actual = $subscriptionDescription->getDefaultMessageTimeToLive();
  94. // Assert
  95. $this->assertEquals(
  96. $expected,
  97. $actual
  98. );
  99. }
  100. /**
  101. * @covers WindowsAzure\ServiceBus\Models\SubscriptionDescription::getDeadLetteringOnMessageExpiration
  102. * @covers WindowsAzure\ServiceBus\Models\SubscriptionDescription::setDeadLetteringOnMessageExpiration
  103. */
  104. public function testGetSetDeadLetteringOnMessageExpiration() {
  105. // Setup
  106. $expected = 'testDeadLetteringOnMessageExpiration';
  107. $subscriptionDescription = new SubscriptionDescription();
  108. // Test
  109. $subscriptionDescription->setDeadLetteringOnMessageExpiration($expected);
  110. $actual = $subscriptionDescription->getDeadLetteringOnMessageExpiration();
  111. // Assert
  112. $this->assertEquals(
  113. $expected,
  114. $actual
  115. );
  116. }
  117. /**
  118. * @covers WindowsAzure\ServiceBus\Models\SubscriptionDescription::getDeadLetteringOnFilterEvaluationExceptions
  119. * @covers WindowsAzure\ServiceBus\Models\SubscriptionDescription::setDeadLetteringOnFilterEvaluationExceptions
  120. */
  121. public function testGetSetDeadLetteringOnFilterEvaluationExceptions() {
  122. // Setup
  123. $expected = 'testDeadLetteringOnFilterEvaluationExceptions';
  124. $subscriptionDescription = new SubscriptionDescription();
  125. // Test
  126. $subscriptionDescription->setDeadLetteringOnFilterEvaluationExceptions($expected);
  127. $actual = $subscriptionDescription->getDeadLetteringOnFilterEvaluationExceptions();
  128. // Assert
  129. $this->assertEquals(
  130. $expected,
  131. $actual
  132. );
  133. }
  134. /**
  135. * @covers WindowsAzure\ServiceBus\Models\SubscriptionDescription::getDefaultRuleDescription
  136. * @covers WindowsAzure\ServiceBus\Models\SubscriptionDescription::setDefaultRuleDescription
  137. */
  138. public function testGetSetDefaultRuleDescription() {
  139. // Setup
  140. $expected = 'testDefaultRuleDescription';
  141. $subscriptionDescription = new SubscriptionDescription();
  142. // Test
  143. $subscriptionDescription->setDefaultRuleDescription($expected);
  144. $actual = $subscriptionDescription->getDefaultRuleDescription();
  145. // Assert
  146. $this->assertEquals(
  147. $expected,
  148. $actual
  149. );
  150. }
  151. /**
  152. * @covers WindowsAzure\ServiceBus\Models\SubscriptionDescription::getMessageCount
  153. * @covers WindowsAzure\ServiceBus\Models\SubscriptionDescription::setMessageCount
  154. */
  155. public function testGetSetMessageCount() {
  156. // Setup
  157. $expected = 'testMessageCount';
  158. $subscriptionDescription = new SubscriptionDescription();
  159. // Test
  160. $subscriptionDescription->setMessageCount($expected);
  161. $actual = $subscriptionDescription->getMessageCount();
  162. // Assert
  163. $this->assertEquals(
  164. $expected,
  165. $actual
  166. );
  167. }
  168. /**
  169. * @covers WindowsAzure\ServiceBus\Models\SubscriptionDescription::getMaxDeliveryCount
  170. * @covers WindowsAzure\ServiceBus\Models\SubscriptionDescription::setMaxDeliveryCount
  171. */
  172. public function testGetSetMaxDeliveryCount() {
  173. // Setup
  174. $expected = 'testMaxDeliveryCount';
  175. $subscriptionDescription = new SubscriptionDescription();
  176. // Test
  177. $subscriptionDescription->setMaxDeliveryCount($expected);
  178. $actual = $subscriptionDescription->getMaxDeliveryCount();
  179. // Assert
  180. $this->assertEquals(
  181. $expected,
  182. $actual
  183. );
  184. }
  185. /**
  186. * @covers WindowsAzure\ServiceBus\Models\SubscriptionDescription::getEnableBatchedOperations
  187. * @covers WindowsAzure\ServiceBus\Models\SubscriptionDescription::setEnableBatchedOperations
  188. */
  189. public function testGetSetEnableBatchedOperations() {
  190. // Setup
  191. $expected = 'testEnableBatchedOperations';
  192. $subscriptionDescription = new SubscriptionDescription();
  193. // Test
  194. $subscriptionDescription->setEnableBatchedOperations($expected);
  195. $actual = $subscriptionDescription->getEnableBatchedOperations();
  196. // Assert
  197. $this->assertEquals(
  198. $expected,
  199. $actual
  200. );
  201. }
  202. }