PageRenderTime 63ms CodeModel.GetById 31ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://bitbucket.org/skudatech/azure-sdk-for-php
PHP | 211 lines | 82 code | 42 blank | 87 comment | 0 complexity | fff91bc7ac6e9a89d91d681b1d212167 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\TopicInfo;
  25. use WindowsAzure\ServiceBus\Models\WrapAccessTokenResult;
  26. /**
  27. * Unit tests for class WrapAccessTokenResult
  28. *
  29. * @category Microsoft
  30. * @package Tests\Unit\WindowsAzure\ServiceBus\Models
  31. * @author Azure PHP SDK <azurephpsdk@microsoft.com>
  32. * @copyright 2012 Microsoft Corporation
  33. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  34. * @version Release: @package_version@
  35. * @link https://github.com/WindowsAzure/azure-sdk-for-php
  36. */
  37. class TopicInfoTest extends \PHPUnit_Framework_TestCase
  38. {
  39. /**
  40. * @covers WindowsAzure\ServiceBus\Models\TopicInfo::__construct
  41. */
  42. public function testTopicInfoConstructor()
  43. {
  44. // Setup
  45. // Test
  46. $topicInfo = new TopicInfo('testNameOfTopic');
  47. // Assert
  48. $this->assertNotNull($topicInfo);
  49. }
  50. /**
  51. * @covers WindowsAzure\ServiceBus\Models\TopicInfo::getTopicDescription
  52. * @covers WindowsAzure\ServiceBus\Models\TopicInfo::setTopicDescription
  53. */
  54. public function testGetSetTopicDescription() {
  55. // Setup
  56. $expected = 'testTopicDescription';
  57. $topicInfo = new TopicInfo();
  58. // Test
  59. $topicInfo->setTopicDescription($expected);
  60. $actual = $topicInfo->getTopicDescription();
  61. // Assert
  62. $this->assertEquals(
  63. $expected,
  64. $actual
  65. );
  66. }
  67. /**
  68. * @covers WindowsAzure\ServiceBus\Models\TopicInfo::getDefaultMessageTimeToLive
  69. * @covers WindowsAzure\ServiceBus\Models\TopicInfo::setDefaultMessageTimeToLive
  70. */
  71. public function testGetSetDefaultMessageTimeToLive() {
  72. // Setup
  73. $expected = 'testDefaultMessageTimeToLive';
  74. $topicInfo = new TopicInfo();
  75. // Test
  76. $topicInfo->setDefaultMessageTimeToLive($expected);
  77. $actual = $topicInfo->getDefaultMessageTimeToLive();
  78. // Assert
  79. $this->assertEquals(
  80. $expected,
  81. $actual
  82. );
  83. }
  84. /**
  85. * @covers WindowsAzure\ServiceBus\Models\TopicInfo::getMaxSizeInMegabytes
  86. * @covers WindowsAzure\ServiceBus\Models\TopicInfo::setMaxSizeInMegabytes
  87. */
  88. public function testGetSetMaxSizeInMegabytes() {
  89. // Setup
  90. $expected = 'testMaxSizeInMegabytes';
  91. $topicInfo = new TopicInfo();
  92. // Test
  93. $topicInfo->setMaxSizeInMegabytes($expected);
  94. $actual = $topicInfo->getMaxSizeInMegabytes();
  95. // Assert
  96. $this->assertEquals(
  97. $expected,
  98. $actual
  99. );
  100. }
  101. /**
  102. * @covers WindowsAzure\ServiceBus\Models\TopicInfo::getRequiresDuplicateDetection
  103. * @covers WindowsAzure\ServiceBus\Models\TopicInfo::setRequiresDuplicateDetection
  104. */
  105. public function testGetSetRequiresDuplicateDetection() {
  106. // Setup
  107. $expected = 'testRequiresDuplicateDetection';
  108. $topicInfo = new TopicInfo();
  109. // Test
  110. $topicInfo->setRequiresDuplicateDetection($expected);
  111. $actual = $topicInfo->getRequiresDuplicateDetection();
  112. // Assert
  113. $this->assertEquals(
  114. $expected,
  115. $actual
  116. );
  117. }
  118. /**
  119. * @covers WindowsAzure\ServiceBus\Models\TopicInfo::getDuplicateDetectionHistoryTimeWindow
  120. * @covers WindowsAzure\ServiceBus\Models\TopicInfo::setDuplicateDetectionHistoryTimeWindow
  121. */
  122. public function testGetSetDuplicateDetectionHistoryTimeWindow() {
  123. // Setup
  124. $expected = 'testDuplicateDetectionHistoryTimeWindow';
  125. $topicInfo = new TopicInfo();
  126. // Test
  127. $topicInfo->setDuplicateDetectionHistoryTimeWindow($expected);
  128. $actual = $topicInfo->getDuplicateDetectionHistoryTimeWindow();
  129. // Assert
  130. $this->assertEquals(
  131. $expected,
  132. $actual
  133. );
  134. }
  135. /**
  136. * @covers WindowsAzure\ServiceBus\Models\TopicInfo::getEnableBatchedOperations
  137. * @covers WindowsAzure\ServiceBus\Models\TopicInfo::setEnableBatchedOperations
  138. */
  139. public function testGetSetEnableBatchedOperations() {
  140. // Setup
  141. $expected = 'testEnableBatchedOperations';
  142. $topicInfo = new TopicInfo();
  143. // Test
  144. $topicInfo->setEnableBatchedOperations($expected);
  145. $actual = $topicInfo->getEnableBatchedOperations();
  146. // Assert
  147. $this->assertEquals(
  148. $expected,
  149. $actual
  150. );
  151. }
  152. /**
  153. * @covers WindowsAzure\ServiceBus\Models\TopicInfo::getSizeInBytes
  154. * @covers WindowsAzure\ServiceBus\Models\TopicInfo::setSizeInBytes
  155. */
  156. public function testGetSetSizeInBytes() {
  157. // Setup
  158. $expected = 'testSizeInBytes';
  159. $topicInfo = new TopicInfo();
  160. // Test
  161. $topicInfo->setSizeInBytes($expected);
  162. $actual = $topicInfo->getSizeInBytes();
  163. // Assert
  164. $this->assertEquals(
  165. $expected,
  166. $actual
  167. );
  168. }
  169. }