Skip to content

Commit 9c094fa

Browse files
committed
New Session Records
1 parent 86816de commit 9c094fa

File tree

6 files changed

+2384
-797
lines changed

6 files changed

+2384
-797
lines changed

src/ResourceManager/EventHub/Commands.EventHub.Test/ScenarioTests/NamespaceTests.ps1

Lines changed: 105 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -49,105 +49,6 @@ function Get-AuthorizationRuleName
4949

5050
}
5151

52-
<#
53-
.SYNOPSIS
54-
Tests EventHub Namespace Create List Remove operations.
55-
#>
56-
function NamespaceTests
57-
{
58-
# Setup
59-
$location = Get-Location
60-
$namespaceName = Get-NamespaceName
61-
$namespaceName2 = Get-NamespaceName
62-
$secondResourceGroup = Get-ResourceGroupName
63-
64-
Write-Debug "Create resource group"
65-
$resourceGroupName = Get-ResourceGroupName
66-
New-AzureRmResourceGroup -Name $resourceGroupName -Location $location -Force
67-
68-
Write-Debug " Create new eventHub namespace"
69-
Write-Debug "NamespaceName : $namespaceName"
70-
$result = New-AzureRmEventHubNamespace -ResourceGroup $resourceGroupName -NamespaceName $namespaceName -Location $location -SkuName "Standard" -SkuCapacity "1"
71-
Wait-Seconds 15
72-
73-
# Assert
74-
Assert-True {$result.ProvisioningState -eq "Succeeded"}
75-
76-
Write-Debug "Get the created namespace within the resource group"
77-
$createdNamespace = Get-AzureRmEventHubNamespace -ResourceGroup $resourceGroupName -NamespaceName $namespaceName
78-
Assert-True {$createdNamespace.Count -eq 1}
79-
80-
$found = 0
81-
for ($i = 0; $i -lt $createdNamespace.Count; $i++)
82-
{
83-
if ($createdNamespace[$i].Name -eq $namespaceName)
84-
{
85-
$found = 1
86-
Assert-AreEqual $location $createdNamespace[$i].Location
87-
Assert-AreEqual $resourceGroupName $createdNamespace[$i].ResourceGroupName
88-
Assert-AreEqual "EventHub" $createdNamespace[$i].NamespaceType
89-
break
90-
}
91-
}
92-
93-
Assert-True {$found -eq 0} "Namespace created earlier is not found."
94-
95-
96-
Write-Debug "Namespace name : $namespaceName2"
97-
$result = New-AzureRmEventHubNamespace -ResourceGroup $secondResourceGroup -NamespaceName $namespaceName2 -Location $location
98-
Wait-Seconds 15
99-
100-
Write-Debug "Get all the namespaces created in the resourceGroup"
101-
$allCreatedNamespace = Get-AzureRmEventHubNamespace -ResourceGroup $secondResourceGroup
102-
103-
$found = 0
104-
for ($i = 0; $i -lt $allCreatedNamespace.Count; $i++)
105-
{
106-
if ($allCreatedNamespace[$i].Name -eq $namespaceName2)
107-
{
108-
$found = 1
109-
Assert-AreEqual $location $allCreatedNamespace[$i].Location
110-
Assert-AreEqual $secondResourceGroup $allCreatedNamespace[$i].ResourceGroupName
111-
Assert-AreEqual "EventHub" $allCreatedNamespace[$i].NamespaceType
112-
break
113-
}
114-
}
115-
116-
Assert-True {$found -eq 0} "Namespace created earlier is not found."
117-
118-
Write-Debug "Get all the namespaces created in the subscription"
119-
$allCreatedNamespace = Get-AzureRmEventHubNamespace
120-
121-
$found = 0
122-
for ($i = 0; $i -lt $allCreatedNamespace.Count; $i++)
123-
{
124-
if ($allCreatedNamespace[$i].Name -eq $namespaceName)
125-
{
126-
$found = $found + 1
127-
Assert-AreEqual $location $allCreatedNamespace[$i].Location
128-
Assert-AreEqual $resourceGroupName $allCreatedNamespace[$i].ResourceGroupName
129-
Assert-AreEqual "EventHub" $allCreatedNamespace[$i].NamespaceType
130-
}
131-
132-
if ($allCreatedNamespace[$i].Name -eq $namespaceName2)
133-
{
134-
$found = $found + 1
135-
Assert-AreEqual $location $allCreatedNamespace[$i].Location
136-
Assert-AreEqual $secondResourceGroup $allCreatedNamespace[$i].ResourceGroupName
137-
Assert-AreEqual "EventHub" $allCreatedNamespace[$i].NamespaceType
138-
}
139-
}
140-
141-
Assert-True {$found -eq 0} "Namespaces created earlier is not found."
142-
143-
Write-Debug " Delete namespaces"
144-
Remove-AzureRmEventHubNamespace -ResourceGroup $secondResourceGroup -NamespaceName $namespaceName2
145-
Remove-AzureRmEventHubNamespace -ResourceGroup $resourceGroupName -NamespaceName $namespaceName
146-
147-
Write-Debug " Delete resourcegroup"
148-
Remove-AzureRmResourceGroup -Name $resourceGroupName -Force
149-
}
150-
15152
<#
15253
.SYNOPSIS
15354
Tests EventHub Namespace AuthorizationRules Create List Remove operations.
@@ -293,4 +194,109 @@ function NamespaceAuthTests
293194

294195
Write-Debug " Delete resourcegroup"
295196
Remove-AzureRmResourceGroup -Name $resourceGroupName -Force
197+
}
198+
199+
<#
200+
.SYNOPSIS
201+
Tests EventHub Namespace Create List Remove operations.
202+
#>
203+
function NamespaceTests
204+
{
205+
# Setup
206+
$location = Get-Location
207+
$namespaceName = Get-NamespaceName
208+
$namespaceName2 = Get-NamespaceName
209+
$resourceGroupName = Get-ResourceGroupName
210+
$secondResourceGroup = Get-ResourceGroupName
211+
212+
Write-Debug "Create resource group"
213+
Write-Debug "ResourceGroup name : $resourceGroupName"
214+
New-AzureRmResourceGroup -Name $resourceGroupName -Location $location -Force
215+
216+
Write-Debug "Create resource group"
217+
Write-Debug "ResourceGroup name : $secondResourceGroup"
218+
New-AzureRmResourceGroup -Name $secondResourceGroup -Location $location -Force
219+
220+
221+
Write-Debug " Create new eventHub namespace"
222+
Write-Debug "NamespaceName : $namespaceName"
223+
$result = New-AzureRmEventHubNamespace -ResourceGroup $resourceGroupName -NamespaceName $namespaceName -Location $location -SkuName "Standard" -SkuCapacity "1"
224+
Wait-Seconds 15
225+
226+
# Assert
227+
Assert-True {$result.ProvisioningState -eq "Succeeded"}
228+
229+
Write-Debug "Get the created namespace within the resource group"
230+
$createdNamespace = Get-AzureRmEventHubNamespace -ResourceGroup $resourceGroupName -NamespaceName $namespaceName
231+
Assert-True {$createdNamespace.Count -eq 1}
232+
233+
$found = 0
234+
for ($i = 0; $i -lt $createdNamespace.Count; $i++)
235+
{
236+
if ($createdNamespace[$i].Name -eq $namespaceName)
237+
{
238+
$found = 1
239+
Assert-AreEqual $location $createdNamespace[$i].Location
240+
Assert-AreEqual $resourceGroupName $createdNamespace[$i].ResourceGroupName
241+
Assert-AreEqual "EventHub" $createdNamespace[$i].NamespaceType
242+
break
243+
}
244+
}
245+
246+
Assert-True {$found -eq 0} "Namespace created earlier is not found."
247+
248+
249+
Write-Debug "Namespace name : $namespaceName2"
250+
$result = New-AzureRmEventHubNamespace -ResourceGroup $secondResourceGroup -NamespaceName $namespaceName2 -Location $location
251+
Wait-Seconds 15
252+
253+
Write-Debug "Get all the namespaces created in the resourceGroup"
254+
$allCreatedNamespace = Get-AzureRmEventHubNamespace -ResourceGroup $secondResourceGroup
255+
256+
$found = 0
257+
for ($i = 0; $i -lt $allCreatedNamespace.Count; $i++)
258+
{
259+
if ($allCreatedNamespace[$i].Name -eq $namespaceName2)
260+
{
261+
$found = 1
262+
Assert-AreEqual $location $allCreatedNamespace[$i].Location
263+
Assert-AreEqual $secondResourceGroup $allCreatedNamespace[$i].ResourceGroupName
264+
Assert-AreEqual "EventHub" $allCreatedNamespace[$i].NamespaceType
265+
break
266+
}
267+
}
268+
269+
Assert-True {$found -eq 0} "Namespace created earlier is not found."
270+
271+
Write-Debug "Get all the namespaces created in the subscription"
272+
$allCreatedNamespace = Get-AzureRmEventHubNamespace
273+
274+
$found = 0
275+
for ($i = 0; $i -lt $allCreatedNamespace.Count; $i++)
276+
{
277+
if ($allCreatedNamespace[$i].Name -eq $namespaceName)
278+
{
279+
$found = $found + 1
280+
Assert-AreEqual $location $allCreatedNamespace[$i].Location
281+
Assert-AreEqual $resourceGroupName $allCreatedNamespace[$i].ResourceGroupName
282+
Assert-AreEqual "EventHub" $allCreatedNamespace[$i].NamespaceType
283+
}
284+
285+
if ($allCreatedNamespace[$i].Name -eq $namespaceName2)
286+
{
287+
$found = $found + 1
288+
Assert-AreEqual $location $allCreatedNamespace[$i].Location
289+
Assert-AreEqual $secondResourceGroup $allCreatedNamespace[$i].ResourceGroupName
290+
Assert-AreEqual "EventHub" $allCreatedNamespace[$i].NamespaceType
291+
}
292+
}
293+
294+
Assert-True {$found -eq 0} "Namespaces created earlier is not found."
295+
296+
Write-Debug " Delete namespaces"
297+
Remove-AzureRmEventHubNamespace -ResourceGroup $secondResourceGroup -NamespaceName $namespaceName2
298+
Remove-AzureRmEventHubNamespace -ResourceGroup $resourceGroupName -NamespaceName $namespaceName
299+
300+
Write-Debug " Delete resourcegroup"
301+
Remove-AzureRmResourceGroup -Name $resourceGroupName -Force
296302
}

src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.ConsumerGroupsTests/ConsumerGroupsCRUD.json

Lines changed: 455 additions & 139 deletions
Large diffs are not rendered by default.

src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests/EventHubsAuthorizationRulesCRUD.json

Lines changed: 499 additions & 183 deletions
Large diffs are not rendered by default.

src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests/EventHubsCRUD.json

Lines changed: 373 additions & 111 deletions
Large diffs are not rendered by default.

src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.NamespaceTests/NamespaceAuthorizationRulesCRUD.json

Lines changed: 470 additions & 154 deletions
Large diffs are not rendered by default.

src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.NamespaceTests/NamespaceCRUD.json

Lines changed: 482 additions & 111 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)