Skip to content

Commit bc52a53

Browse files
committed
PR fixes
1 parent 4392b1f commit bc52a53

File tree

3 files changed

+386
-143
lines changed

3 files changed

+386
-143
lines changed

src/LogicApp/LogicApp.Test/ScenarioTests/WorkflowTests.ps1

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,23 @@ function Test-CreateAndGetLogicAppUsingDefinitionWithActions
188188
$workflow3 = Get-AzLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName -Version $workflow1.Version
189189
Assert-NotNull $workflow3
190190

191-
# Test 4: Get non-existing logic app using get cmdlet
191+
# Test 4: Get all workflows in ResourceGroup
192+
$workflow4 = Get-AzLogicApp -ResourceGroupName $resourceGroupName
193+
Assert-NotNull $workflow4
194+
Assert-True { $workflow4.Length -ge 1 }
195+
196+
# Test 5: Get all workflows in Subscription
197+
$workflow5 = Get-AzLogicApp
198+
Assert-NotNull $workflow5
199+
Assert-True { $workflow5.Length -ge 1 }
200+
201+
# Test 6: Get workflow with just name parameter
202+
# refortie (1/31/19): TODO Test is disabled for now, we only return the first page on get logic app by subscription
203+
# $workflow6 = Get-AzLogicApp -Name $workflowName
204+
# Assert-NotNull $workflow6
205+
# Assert-True { $workflow6.Length -ge 1 }
206+
207+
# Test 7: Get non-existing logic app using get cmdlet
192208
try
193209
{
194210
Get-AzLogicApp -ResourceGroupName $resourceGroupName -Name "InvalidWorkflow"
@@ -198,7 +214,7 @@ function Test-CreateAndGetLogicAppUsingDefinitionWithActions
198214
Assert-AreEqual $_.Exception.Message "The Resource 'Microsoft.Logic/workflows/InvalidWorkflow' under resource group '$resourceGroupName' was not found."
199215
}
200216

201-
Remove-AzLogicApp -ResourceGroupName $resourceGroup.ResourceGroupName -Name $workflowName -Force
217+
Remove-AzLogicApp -ResourceGroupName $resourceGroup.ResourceGroupName -Name $workflowName -Force
202218
}
203219

204220
<#
@@ -302,7 +318,17 @@ function Test-ValidateLogicApp
302318
$definition = [IO.File]::ReadAllText($definitionFilePath)
303319
Test-AzLogicApp -ResourceGroupName $resourceGroup.ResourceGroupName -Name $workflowName -Location $location -Definition $definition -ParameterFilePath $parameterFilePath
304320

305-
Remove-AzLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName -Force
321+
# Test 3: Failure for an invalid definition.
322+
try
323+
{
324+
Test-AzLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName -Location $location -Definition '{}'
325+
}
326+
catch
327+
{
328+
Assert-AreEqual $_.Exception.Message "The request content is not valid and could not be deserialized: 'Required property '`$schema' not found in JSON. Path 'properties.definition', line 4, position 20.'."
329+
}
330+
331+
Remove-AzLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName -Force
306332
}
307333

308334
<#

0 commit comments

Comments
 (0)