Inconsistencies Part 1 (examples/) (#288)

* Resolve spacing and names

* utf8 with bom

* Align splatted variables

* Fix names of resources

* Update act comments to act and assert

* Fix parameter names in markdowns and sql server and database names in tests

* Add more descriptive test names for property key and value assertions
This commit is contained in:
Mary Sha 2023-04-04 13:52:01 -07:00 коммит произвёл GitHub
Родитель 0f5a2f86c5
Коммит e64f9cdf29
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
30 изменённых файлов: 679 добавлений и 652 удалений

Просмотреть файл

@ -11,20 +11,20 @@ Describe 'Verify Action Group' {
$Script:noActionGroupName = "noactiongroup"
}
It "Should contain an actiongroup named $actionGroupName - Confirm-AzBPResource" {
#arrange
It "Should contain an Action Group named $actionGroupName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = 'ActionGroup'
ResourceName = $actionGroupName
ResourceGroupName = $rgName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain an actiongroup named $actionGroupName - Confirm-AzBPResource" {
#arrange
It "Should contain an Action Group named $actionGroupName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = 'ActionGroup'
ResourceName = $actionGroupName
@ -33,15 +33,16 @@ Describe 'Verify Action Group' {
PropertyValue = $actionGroupName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain an action group named $actionGroupName" {
It "Should contain an Action Group named $actionGroupName" {
Confirm-AzBPActionGroup -ResourceGroupName $rgName -ActionGroupName $actionGroupName | Should -BeSuccessful
}
It 'Should not contain an action group with given name' {
It "Should not contain an Action Group named $noActionGroupName" {
# arrange
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
@ -50,15 +51,16 @@ Describe 'Verify Action Group' {
ActionGroupName = $noActionGroupName
ErrorAction = "SilentlyContinue"
}
# act and assert
Confirm-AzBPActionGroup @params | Should -Not -BeSuccessful
}
It "Should contain an action group named $actionGroupName in $location" {
It "Should contain an Action Group named $actionGroupName in $location" {
Confirm-AzBPActionGroup -ResourceGroupName $rgName -ActionGroupName $actionGroupName
| Should -BeInLocation $location
}
It "Should be an action group named $actionGroupName in a resource group named $rgName" {
It "Should contain an Action Group named $actionGroupName in $rgName" {
Confirm-AzBPActionGroup -ResourceGroupName $rgName -ActionGroupName $actionGroupName
| Should -BeInResourceGroup $rgName
}

Просмотреть файл

@ -12,19 +12,19 @@ Describe 'Verify AKS Cluster' {
}
It "Should contain an AKS Cluster named $aksName - Confirm-AzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "AksCluster"
ResourceName = $aksName
ResourceGroupName = $rgName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain an AKS Cluster named $aksName - Confirm-AzBPResource" {
#arrange
It "Should contain an AKS Cluster named $aksName with an Agent Pool Profile named agentpool - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "AksCluster"
ResourceName = $aksName
@ -33,7 +33,7 @@ Describe 'Verify AKS Cluster' {
PropertyValue = "agentpool"
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
@ -41,7 +41,7 @@ Describe 'Verify AKS Cluster' {
Confirm-AzBPAksCluster -ResourceGroupName $rgName -AKSName $aksName | Should -BeSuccessful
}
It 'Should not contain an AKS cluster with given name' {
It "Should not contain an AKS Cluster named $noAksClusterName" {
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
@ -52,7 +52,7 @@ Describe 'Verify AKS Cluster' {
Confirm-AzBPAksCluster -ResourceGroupName $rgName -AKSName $aksName | Should -BeInLocation $location
}
It "Should be an AKS CLuster named $aksName in a resource group named $rgName" {
It "Should contain an AKS Cluster named $aksName in $rgName" {
Confirm-AzBPAksCluster -ResourceGroupName $rgName -AKSName $aksName | Should -BeInResourceGroup $rgName
}
}

Просмотреть файл

@ -12,28 +12,28 @@ Describe 'Verify API Management Service' {
$Script:noApiServiceName = 'noservice'
}
It 'Should contain an API Management Service with the given name - Confirm-AzBPResource' {
#arrange
It 'Should contain an API Management Service named $apiServiceName - Confirm-AzBPResource' {
# arrange
$params = @{
ResourceType = "ApiManagement"
ResourceType = "ApiManagement"
ResourceGroupName = $rgName
ResourceName = $apiServiceName
ResourceName = $apiServiceName
}
#act and assert
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain an API Management Service named $apiServiceName - ConfirmAzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "ApiManagement"
ResourceType = "ApiManagement"
ResourceGroupName = $rgName
ResourceName = $apiServiceName
PropertyKey = 'Name'
PropertyValue = $apiServiceName
ResourceName = $apiServiceName
PropertyKey = 'Name'
PropertyValue = $apiServiceName
}
#act and assert
# act and assert
Confirm-AzBPResource @params | -BeSuccessful
}
@ -41,18 +41,18 @@ Describe 'Verify API Management Service' {
Confirm-AzBPApiManagement -ResourceGroupName $rgName -Name $apiServiceName | Should -BeSuccessful
}
It 'Should not contain an API Management Service with the given name' {
#arrange
$params = @{
ResourceGroupName = $rgName
Name = $noApiServiceName
ErrorAction = "SilentlyContinue"
}
#act and assert
It "Should not contain an API Management Service named $noApiServiceName" {
# arrange
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
$params = @{
ResourceGroupName = $rgName
Name = $noApiServiceName
ErrorAction = "SilentlyContinue"
}
# act and assert
Confirm-AzBPApiManagement @params | Should -Not -BeSuccessful
}
@ -60,7 +60,7 @@ Describe 'Verify API Management Service' {
Confirm-AzBPApiManagement -ResourceGroupName $rgName -Name $apiServiceName | Should -BeInLocation $location
}
It "Should be an API Management Service in a resource group named $rgName" {
It "Should contain an API Management Service named $apiServiceName in $rgName" {
Confirm-AzBPApiManagement -ResourceGroupName $rgName -Name $apiServiceName | Should -BeInResourceGroup $rgName
}
}
@ -70,31 +70,31 @@ Describe 'Verify API Management API' {
$Script:noApiName = 'noapi'
}
It 'Should contain an API Management API with the given name - Confirm-AzBPResource' {
#arrange
It "Should contain an API Management API named $apiName - ConfirmAzBPResource" {
# arrange
$params = @{
ResourceType = "ApiManagementApi"
ResourceType = "ApiManagementApi"
ResourceGroupName = $rgName
ServiceName = $apiServiceName
ResourceName = $apiName
ServiceName = $apiServiceName
ResourceName = $apiName
}
#act and assert
# act and assert
Confirm-AzBPResource @params | -BeSuccessful
}
It "Should contain an API Management API named $apiName - ConfirmAzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "ApiManagementApi"
ResourceType = "ApiManagementApi"
ResourceGroupName = $rgName
ServiceName = $apiServiceName
ResourceName = $apiName
PropertyKey = 'Name'
PropertyValue = $apiName
ServiceName = $apiServiceName
ResourceName = $apiName
PropertyKey = 'Name'
PropertyValue = $apiName
}
#act and assert
# act and assert
Confirm-AzBPResource @params | -BeSuccessful
}
@ -103,23 +103,23 @@ Describe 'Verify API Management API' {
| Should -BeSuccessful
}
It 'Should not contain an API Management API with the given name' {
It "Should not contain an API Management API named $noApiName" {
# arrange
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
$params = @{
ResourceGroupName = $rgName
Name = $noApiName
ServiceName = $apiServiceName
ErrorAction = "SilentlyContinue"
Name = $noApiName
ServiceName = $apiServiceName
ErrorAction = "SilentlyContinue"
}
#act and assert
# act and assert
Confirm-AzBPApiManagementApi @params | Should -Not -BeSuccessful
}
It "Should be an API Management API in a resource group named $rgName" {
It "Should contain an API Management API named $apiName in $rgName" {
Confirm-AzBPApiManagementApi -ResourceGroupName $rgName -ServiceName $apiServiceName -Name $apiName
| Should -BeInResourceGroup $rgName
}
@ -131,70 +131,70 @@ Describe 'Verify API Management Diagnostic' {
$Script:noDiagnosticName = 'nodiag'
}
It 'Should contain an API Management Diagnostic with the given name - Confirm-AzBPResource' {
#arrange
It "Should contain an API Management Diagnostic named $diagnosticName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "ApiManagementDiagnostic"
ResourceType = "ApiManagementDiagnostic"
ResourceGroupName = $rgName
ServiceName = $apiServiceName
ResourceName = $diagnosticName
ServiceName = $apiServiceName
ResourceName = $diagnosticName
}
#act and assert
# act and assert
Confirm-AzBPResource @params | -BeSuccessful
}
It "Should contain an API Management Diagnostic named $diagnosticName - ConfirmAzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "ApiManagementDiagnostic"
ResourceType = "ApiManagementDiagnostic"
ResourceGroupName = $rgName
ServiceName = $apiServiceName
ResourceName = $diagnosticName
PropertyKey = 'DiagnosticId'
PropertyValue = $diagnosticName
ServiceName = $apiServiceName
ResourceName = $diagnosticName
PropertyKey = 'DiagnosticId'
PropertyValue = $diagnosticName
}
#act and assert
# act and assert
Confirm-AzBPResource @params | -BeSuccessful
}
It "Should contain an API Management Diagnostic named $diagnosticName" {
#arrange
# arrange
$params = @{
ResourceGroupName = $rgName
ServiceName = $apiServiceName
Name = $diagnosticName
ServiceName = $apiServiceName
Name = $diagnosticName
}
#act and assert
# act and assert
Confirm-AzBPApiManagementDiagnostic @params | Should -BeSuccessful
}
It 'Should not contain an API Management Diagnostic with the given name' {
#arrange
$params = @{
ResourceGroupName = $rgName
ServiceName = $apiServiceName
Name = $noDiagnosticName
ErrorAction = "SilentlyContinue"
}
#act and assert
It "Should not contain an API Management Diagnostic named $noDiagnosticName" {
# arrange
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
$params = @{
ResourceGroupName = $rgName
ServiceName = $apiServiceName
Name = $noDiagnosticName
ErrorAction = "SilentlyContinue"
}
# act and assert
Confirm-AzBPApiManagementDiagnostic @params | Should -Not -BeSuccessful
}
It "Should be an API Management Diagnostic in a resource group named $rgName" {
It "Should contain an API Management Diagnostic named $diagnosticName in $rgName" {
$params = @{
ResourceGroupName = $rgName
ServiceName = $apiServiceName
Name = $diagnosticName
ServiceName = $apiServiceName
Name = $diagnosticName
}
#act and assert
# act and assert
Confirm-AzBPApiManagementDiagnostic @params | Should -BeInResourceGroup $rgName
}
}
@ -205,70 +205,71 @@ Describe 'Verify API Management Logger' {
$Script:noLoggerName = 'nologger'
}
It 'Should contain an API Management Logger with the given name - Confirm-AzBPResource' {
#arrange
It "Should contain an API Management Logger named $loggerName - ConfirmAzBPResource" {
# arrange
$params = @{
ResourceType = "ApiManagementLogger"
ResourceType = "ApiManagementLogger"
ResourceGroupName = $rgName
ServiceName = $apiServiceName
ResourceName = $loggerName
ServiceName = $apiServiceName
ResourceName = $loggerName
}
#act and assert
# act and assert
Confirm-AzBPResource @params | -BeSuccessful
}
It "Should contain an API Management Logger named $loggerName - ConfirmAzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "ApiManagementLogger"
ResourceType = "ApiManagementLogger"
ResourceGroupName = $rgName
ServiceName = $apiServiceName
ResourceName = $loggerName
PropertyKey = 'LoggerId'
PropertyValue = $loggerName
ServiceName = $apiServiceName
ResourceName = $loggerName
PropertyKey = 'LoggerId'
PropertyValue = $loggerName
}
#act and assert
# act and assert
Confirm-AzBPResource @params | -BeSuccessful
}
It "Should contain an API Management Logger named $loggerName" {
#arrange
# arrange
$params = @{
ResourceGroupName = $rgName
ServiceName = $apiServiceName
Name = $loggerName
ServiceName = $apiServiceName
Name = $loggerName
}
#act and assert
# act and assert
Confirm-AzBPApiManagementLogger @params | Should -BeSuccessful
}
It 'Should not contain an API Management Logger with the given name' {
#arrange
$params = @{
ResourceGroupName = $rgName
ServiceName = $apiServiceName
Name = $noLoggerName
ErrorAction = "SilentlyContinue"
}
#act and assert
It "Should not contain an API Management Logger named $noLoggerName" {
# arrange
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
$params = @{
ResourceGroupName = $rgName
ServiceName = $apiServiceName
Name = $noLoggerName
ErrorAction = "SilentlyContinue"
}
# act and assert
Confirm-AzBPApiManagementLogger @params | Should -Not -BeSuccessful
}
It "Should be an API Management Logger in a resource group named $rgName" {
It "Should contain an API Management Logger named $loggerName in $rgName" {
# arrange
$params = @{
ResourceGroupName = $rgName
ServiceName = $apiServiceName
Name = $loggerName
ServiceName = $apiServiceName
Name = $loggerName
}
#act and assert
# act and assert
Confirm-AzBPApiManagementLogger @params | Should -BeInResourceGroup $rgName
}
}
@ -279,43 +280,43 @@ Describe 'Verify API Management Policy' {
}
It "Should contain an API Management Policy for the API ID $apiName - Confirm-AzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "ApiManagementPolicy"
ResourceType = "ApiManagementPolicy"
ResourceGroupName = $rgName
ServiceName = $apiServiceName
ResourceName = $apiName
ServiceName = $apiServiceName
ResourceName = $apiName
}
#act and assert
# act and assert
Confirm-AzBPResource @params | -BeSuccessful
}
It "Should contain an API Management Policy for the API ID $apiName" {
#arrange
# arrange
$params = @{
ResourceGroupName = $rgName
ServiceName = $apiServiceName
ApiId = $apiName
ServiceName = $apiServiceName
ApiId = $apiName
}
#act and assert
# act and assert
Confirm-AzBPApiManagementPolicy @params | -BeSuccessful
}
It "Should not contain an API Management Policy for the API ID $apiName" {
#arrange
$params = @{
ResourceGroupName = $rgName
ServiceName = $apiServiceName
ApiId = $noApiId
ErrorAction = "SilentlyContinue"
}
#act and assert
# arrange
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
$params = @{
ResourceGroupName = $rgName
ServiceName = $apiServiceName
ApiId = $noApiId
ErrorAction = "SilentlyContinue"
}
# act and assert
Confirm-AzBPApiManagementPolicy @params | Should -Not -BeSuccessful
}
}

Просмотреть файл

@ -30,7 +30,7 @@ cmdlets.
- `apitest` -> `your-api-management-api-name`
- `diagtest` -> `your-api-management-diagnostic-name`
- `loggertest` -> `your-api-managemetn-logger-name`
- `westus` -> `your-resource-group-location`
- `westus3` -> `your-resource-group-location`
1. If using a local copy of `Az.InfrastructureTesting`, replace `Import-Module Az.InfrastructureTesting` with
`Import-Module "../../bin/BenchPress.Azure.psd1"`.

Просмотреть файл

@ -6,25 +6,26 @@
$Script:location = 'westus3'
}
Describe 'Verify App Insights' {
Describe 'Verify Application Insights' {
BeforeAll {
$Script:noAppInsightsName = 'noappinsights'
}
It "Should contain an App Insights named $appInsightsName - Confirm-AzBPResource" {
#arrange
It "Should contain an Application Insights named $appInsightsName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "AppInsights"
ResourceName = $appInsightsName
ResourceGroupName = $rgName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain an App Insights named $appInsightsName - Confirm-AzBPResource" {
#arrange
It "Should contain an Application Insights named $appInsightsName with Application Type of web -
Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "AppInsights"
ResourceName = $appInsightsName
@ -33,15 +34,15 @@ Describe 'Verify App Insights' {
PropertyValue = "web"
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain an App Insights named $appInsightsName" {
It "Should contain an Application Insights named $appInsightsName" {
Confirm-AzBPAppInsights -ResourceGroupName $rgName -Name $appInsightsName | Should -BeSuccessful
}
It 'Should not contain an application insights with the given name' {
It "Should not contain an Application Insights named $noAppInsightsName" {
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
@ -49,11 +50,11 @@ Describe 'Verify App Insights' {
| Should -Not -BeSuccessful
}
It "Should contain an App Insights named $appInsightsName in $location" {
It "Should contain an Application Insights named $appInsightsName in $location" {
Confirm-AzBPAppInsights -ResourceGroupName $rgName -Name $appInsightsName | Should -BeInLocation $location
}
It "Should contain an App Insights named $appInsightsName in a resource group named $rgName" {
It "Should contain an Application Insights named $appInsightsName in $rgName" {
Confirm-AzBPAppInsights -ResourceGroupName $rgName -Name $appInsightsName | Should -BeInResourceGroup $rgName
}
}

Просмотреть файл

@ -12,19 +12,19 @@ Describe 'Verify App Service Plan' {
}
It "Should contain an App Service Plan named $appServicePlanName - Confirm-AzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "Appserviceplan"
ResourceName = $appServicePlanName
ResourceGroupName = $rgName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain an App Service Plan named $appServicePlanName - Confirm-AzBPResource" {
#arrange
It "Should contain an App Service Plan named $appServicePlanName with a Free SKU - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "Appserviceplan"
ResourceName = $appServicePlanName
@ -33,7 +33,7 @@ Describe 'Verify App Service Plan' {
PropertyValue = "Free"
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
@ -42,7 +42,8 @@ Describe 'Verify App Service Plan' {
| Should -BeSuccessful
}
It 'Should not contain an App Service Plan with the given name' {
It "Should not contain an App Service Plan named $noAppServicePlanName" {
# arrange
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
@ -51,6 +52,8 @@ Describe 'Verify App Service Plan' {
AppServicePlanName = $noAppServicePlanName
ErrorAction = "SilentlyContinue"
}
# act and assert
Confirm-AzBPAppServicePlan @params | Should -Not -BeSuccessful
}
@ -59,7 +62,7 @@ Describe 'Verify App Service Plan' {
| Should -BeInLocation $location
}
It "Should contain an App Service Plan named $appServicePlanName in a resource group named $rgName" {
It "Should contain an App Service Plan named $appServicePlanName in $rgName" {
Confirm-AzBPAppServicePlan -ResourceGroupName $rgName -AppServicePlanName $appServicePlanName
| Should -BeInResourceGroup $rgName
}

Просмотреть файл

@ -1,23 +1,23 @@
BeforeAll {
BeforeAll {
Import-Module Az.InfrastructureTesting
}
Describe 'Spin up , Tear down Action Group' {
It 'Should deploy a bicep file.' {
#arrange
# arrange
$resourceGroupName = "rg-test"
$bicepPath = "../ActionGroup/actionGroup.bicep"
$params = @{
actionGroupName = "sampleaction"
location = "swedencentral"
location = "swedencentral"
}
#act
# act
$deployment = Deploy-AzBPBicepFeature -BicepPath $bicepPath -Params $params -ResourceGroupName $resourceGroupName
#assert
# assert
$deployment.ProvisioningState | Should -Be "Succeeded"
#clean up
# clean up
#Remove-AzBPBicepFeature -ResourceGroupName $resourceGroupName
}
}

Просмотреть файл

@ -6,20 +6,20 @@
}
Describe 'Verify Resource Exists' {
It "Should have a resource group called $rgName" {
It "Should contain a Resource Group called $rgName" {
Get-AzBPResourceByType -ResourceType "ResourceGroup" -ResourceName $rgName | Should -BeSuccessful
}
It "Should have a virtual machine named $resourceName" {
It "Should contain a Virtual Machine named $resourceName" {
Get-AzBPResourceByType -ResourceType "VirtualMachine" -ResourceName $resourceName -ResourceGroupName $rgName
| Should -BeSuccessful
}
It "Should have a resource with name of $resourceName" {
#act
It "Should contain a resource named $resourceName" {
# act
$exists = Get-AzBPResource -ResourceName $resourceName
#assert
# assert
$exists | Should -Not -Be $null
}
}

Просмотреть файл

@ -12,19 +12,19 @@ Describe 'Verify Container Application' {
}
It "Should contain a Container Application named $conAppName - Confirm-AzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "ContainerApp"
ResourceName = $conAppName
ResourceGroupName = $rgName
}
#act and assert
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Container Application with an Ingress Port of 80 - Confirm-AzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "ContainerApp"
ResourceName = $conAppName
@ -33,7 +33,7 @@ Describe 'Verify Container Application' {
PropertyValue = 80
}
#act and assert
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
@ -42,6 +42,7 @@ Describe 'Verify Container Application' {
}
It "Should not contain a Container Application named $noContainerAppName" {
# arrange
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
@ -51,6 +52,7 @@ Describe 'Verify Container Application' {
ErrorAction = 'SilentlyContinue'
}
# act and assert
Confirm-AzBPContainerApp @params | Should -Not -BeSuccessful
}

Просмотреть файл

@ -11,20 +11,20 @@ Describe 'Verify Container Registry' {
$Script:noContainerRegistryName = 'nocontainerregistry'
}
It "Should contain a container registry named $acrName - Confirm-AzBPResource" {
#arrange
It "Should contain a Container Registry named $acrName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "ContainerRegistry"
ResourceName = $acrName
ResourceGroupName = $rgName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a container registry named $acrName - Confirm-AzBPResource" {
#arrange
It "Should contain a Container Registry named $acrName with a Standard SKU - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "ContainerRegistry"
ResourceName = $acrName
@ -33,7 +33,7 @@ Describe 'Verify Container Registry' {
PropertyValue = "Standard"
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
@ -41,7 +41,8 @@ Describe 'Verify Container Registry' {
Confirm-AzBPContainerRegistry -ResourceGroupName $rgName -Name $acrName | Should -BeSuccessful
}
It 'Should not contain a container registry with the given name' {
It "Should not contain a Container Registry named $noContainerRegistryName" {
# arrange
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
@ -50,6 +51,8 @@ Describe 'Verify Container Registry' {
Name = $noContainerRegistryName
ErrorAction = "SilentlyContinue"
}
# act and assert
Confirm-AzBPContainerRegistry @params | Should -Not -BeSuccessful
}
@ -57,7 +60,7 @@ Describe 'Verify Container Registry' {
Confirm-AzBPContainerRegistry -ResourceGroupName $rgName -Name $acrName | Should -BeInLocation $location
}
It "Should contain a Container Registry named $acrName in a resource group named $rgName" {
It "Should contain a Container Registry named $acrName in $rgName" {
Confirm-AzBPContainerRegistry -ResourceGroupName $rgName -Name $acrName | Should -BeInResourceGroup $rgName
}
}

Просмотреть файл

@ -12,20 +12,21 @@
}
Describe 'Verify Cosmos DB Account' {
It "Should contain a gremlin Cosmos DB Account named $gremlinAccountName - Confirm-AzBPResource" {
#arrange
It "Should contain a Gremlin Cosmos DB Account named $gremlinAccountName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "CosmosDBAccount"
ResourceName = $gremlinAccountName
ResourceGroupName = $rgName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a gremlin Cosmos DB Account named $gremlinAccountName - Confirm-AzBPResource" {
#arrange
It "Should contain a Gremlin Cosmos DB Account named $gremlinAccountName that is a Global Document DB -
Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "CosmosDBAccount"
ResourceName = $gremlinAccountName
@ -34,12 +35,12 @@ Describe 'Verify Cosmos DB Account' {
PropertyValue = "GlobalDocumentDB"
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a gremlin Cosmos DB named $gremlinDatabaseName - Confirm-AzBPResource" {
#arrange
It "Should contain a Gremlin Cosmos DB named $gremlinDatabaseName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "CosmosDBGremlinDatabase"
ResourceName = $gremlinDatabaseName
@ -47,12 +48,12 @@ Describe 'Verify Cosmos DB Account' {
AccountName = $gremlinAccountName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a gremlin Cosmos DB named $gremlinDatabaseName - Confirm-AzBPResource" {
#arrange
It "Should contain a Gremlin Cosmos DB named $gremlinDatabaseName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "CosmosDBGremlinDatabase"
ResourceName = $gremlinDatabaseName
@ -62,26 +63,27 @@ Describe 'Verify Cosmos DB Account' {
PropertyValue = $gremlinDatabaseName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
#######################################################################################################################
It "Should contain a mongo Cosmos DB Account named $mongoAccountName - Confirm-AzBPResource" {
#arrange
It "Should contain a Mongo Cosmos DB Account named $mongoAccountName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "CosmosDBAccount"
ResourceName = $mongoAccountName
ResourceGroupName = $rgName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a mongo Cosmos DB Account named $mongoAccountName - Confirm-AzBPResource" {
#arrange
It "Should contain a Mongo Cosmos DB Account named $mongoAccountName that is a Global Document DB -
Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "CosmosDBAccount"
ResourceName = $mongoAccountName
@ -90,12 +92,12 @@ Describe 'Verify Cosmos DB Account' {
PropertyValue = "GlobalDocumentDB"
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a mongo Cosmos DB named $mongoDatabaseName - Confirm-AzBPResource" {
#arrange
It "Should contain a Mongo Cosmos DB named $mongoDatabaseName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "CosmosDBMongoDBDatabase"
ResourceName = $mongoDatabaseName
@ -103,12 +105,12 @@ Describe 'Verify Cosmos DB Account' {
AccountName = $mongoAccountName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a mongo Cosmos DB named $mongoDatabaseName- Confirm-AzBPResource" {
#arrange
It "Should contain a Mongo Cosmos DB named $mongoDatabaseName- Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "CosmosDBMongoDBDatabase"
ResourceName = $mongoDatabaseName
@ -118,26 +120,27 @@ Describe 'Verify Cosmos DB Account' {
PropertyValue = $mongoDatabaseName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
#######################################################################################################################
It "Should contain a sql Cosmos DB Account named $sqlAccountName - Confirm-AzBPResource" {
#arrange
It "Should contain a SQL Cosmos DB Account named $sqlAccountName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "CosmosDBAccount"
ResourceName = $sqlAccountName
ResourceGroupName = $rgName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a sql Cosmos DB Account named $sqlAccountName - Confirm-AzBPResource" {
#arrange
It "Should contain a SQL Cosmos DB Account named $sqlAccountName that is a Global Document DB -
Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "CosmosDBAccount"
ResourceName = $sqlAccountName
@ -146,12 +149,12 @@ Describe 'Verify Cosmos DB Account' {
PropertyValue = "GlobalDocumentDB"
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a sql Cosmos DB named $sqlDatabaseName - Confirm-AzBPResource" {
#arrange
It "Should contain a SQL Cosmos DB named $sqlDatabaseName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "CosmosDBSQLDatabase"
ResourceName = $sqlDatabaseName
@ -159,12 +162,12 @@ Describe 'Verify Cosmos DB Account' {
AccountName = $sqlAccountName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a sql Cosmos DB named $sqlDatabaseName - Confirm-AzBPResource" {
#arrange
It "Should contain a SQL Cosmos DB named $sqlDatabaseName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "CosmosDBSQLDatabase"
ResourceName = $sqlDatabaseName
@ -174,7 +177,7 @@ Describe 'Verify Cosmos DB Account' {
PropertyValue = $sqlDatabaseName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
}
@ -189,18 +192,18 @@ Describe 'Cosmos DB Gremlin Database' {
Confirm-AzBPCosmosDBAccount -ResourceGroupName $rgName -Name $gremlinAccountName | Should -BeSuccessful
}
It 'Should not contain a Cosmos DB account with the given name' {
#arrange
It "Should not contain a Cosmos DB account named $noGremlinDBAccountName" {
# The 'ErrorAction = SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
# arrange
$params = @{
ResourceGroupName = $rgName
Name = $noGremlinDBAccountName
ErrorAction = "SilentlyContinue"
}
#act
# act and assert
Confirm-AzBPCosmosDBAccount @params | Should -Not -BeSuccessful
}
@ -216,22 +219,22 @@ Describe 'Cosmos DB Gremlin Database' {
#######################################################################################################################
It "Should contain a Cosmos DB Gremlin Database named $gremlinDatabaseName" {
#arrange
# arrange
$params = @{
ResourceGroupName = $rgName
AccountName = $gremlinAccountName
Name = $gremlinDatabaseName
}
#act
# act and assert
Confirm-AzBPCosmosDBGremlinDatabase @params | Should -BeSuccessful
}
It 'Should not contain a Cosmos DB Gremlin database with the given name' {
#arrange
It "Should not contain a Cosmos DB Gremlin Database named $noGremlinDBName" {
# The 'ErrorAction = SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
# arrange
$params = @{
ResourceGroupName = $rgName
AccountName = $gremlinAccountName
@ -239,31 +242,31 @@ Describe 'Cosmos DB Gremlin Database' {
ErrorAction = "SilentlyContinue"
}
#act
# act and assert
Confirm-AzBPCosmosDBGremlinDatabase @params | Should -Not -BeSuccessful
}
It "Should contain a Cosmos DB Gremlin Database named $gremlinDatabaseName in $location" {
#arrange
# arrange
$params = @{
ResourceGroupName = $rgName
AccountName = $gremlinAccountName
Name = $gremlinDatabaseName
}
#act
# act and assert
Confirm-AzBPCosmosDBGremlinDatabase @params | Should -BeInLocation $location
}
It "Should contain a Cosmos DB Gremlin Database named $gremlinDatabaseName in $rgName" {
#arrange
# arrange
$params = @{
ResourceGroupName = $rgName
AccountName = $gremlinAccountName
Name = $gremlinDatabaseName
}
#act
# act and assert
Confirm-AzBPCosmosDBGremlinDatabase @params | Should -BeInResourceGroup $rgName
}
}
@ -278,8 +281,8 @@ Describe 'Comsos DB Mongo DB Database' {
Confirm-AzBPCosmosDBAccount -ResourceGroupName $rgName -Name $mongoAccountName | Should -BeSuccessful
}
It 'Should not contain a Cosmos DB Mongo account with the given name' {
#arrange
It "Should not contain a Cosmos DB Account named $noMongoDBAccountName" {
# arrange
# The 'ErrorAction = SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
@ -289,7 +292,7 @@ Describe 'Comsos DB Mongo DB Database' {
ErrorAction = "SilentlyContinue"
}
#act
# act and assert
Confirm-AzBPCosmosDBAccount @params | Should -Not -BeSuccessful
}
@ -304,19 +307,19 @@ Describe 'Comsos DB Mongo DB Database' {
#######################################################################################################################
It "Should contain a Cosmos DB Mongo DB Database named $mongoDatabaseName" {
#arrange
# arrange
$params = @{
ResourceGroupName = $rgName
AccountName = $mongoAccountName
Name = $mongoDatabaseName
}
#act
# act and assert
Confirm-AzBPCosmosDBMongoDBDatabase @params | Should -BeSuccessful
}
It 'Should not contain a Cosmos DB Mongo DB database with the given name' {
#arrange
It "Should not contain a Cosmos DB Mongo DB Database named $noMongoDBName" {
# arrange
# The 'ErrorAction = SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
@ -327,31 +330,31 @@ Describe 'Comsos DB Mongo DB Database' {
ErrorAction = "SilentlyContinue"
}
#act
# act and assert
Confirm-AzBPCosmosDBMongoDBDatabase @params | Should -Not -BeSuccessful
}
It "Should contain a Cosmos DB Mongo DB Database named $mongoDatabaseName in $location" {
#arrange
# arrange
$params = @{
ResourceGroupName = $rgName
AccountName = $mongoAccountName
Name = $mongoDatabaseName
}
#act
# act and assert
Confirm-AzBPCosmosDBMongoDBDatabase @params | Should -BeInLocation $location
}
It "Should contain a Cosmos DB Mongo DB Database named $mongoDatabaseName in $rgName" {
#arrange
# arrange
$params = @{
ResourceGroupName = $rgName
AccountName = $mongoAccountName
Name = $mongoDatabaseName
}
#act
# act and assert
Confirm-AzBPCosmosDBMongoDBDatabase @params | Should -BeInResourceGroup $rgName
}
}
@ -366,8 +369,8 @@ Describe 'Comsos DB SQL Database' {
Confirm-AzBPCosmosDBAccount -ResourceGroupName $rgName -Name $sqlAccountName | Should -BeSuccessful
}
It 'Should not contain a Cosmos DB SQL account with the given name' {
#arrange
It "Should not contain a Cosmos DB Account named $noSqlAccountName" {
# arrange
# The 'ErrorAction = SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
@ -377,7 +380,7 @@ Describe 'Comsos DB SQL Database' {
ErrorAction = "SilentlyContinue"
}
#act
# act and assert
Confirm-AzBPCosmosDBAccount @params | Should -Not -BeSuccessful
}
@ -392,19 +395,19 @@ Describe 'Comsos DB SQL Database' {
#######################################################################################################################
It "Should contain a Cosmos DB SQL Database named $sqlDatabaseName" {
#arrange
# arrange
$params = @{
ResourceGroupName = $rgName
AccountName = $sqlAccountName
Name = $sqlDatabaseName
}
#act
# act and assert
Confirm-AzBPCosmosDBSqlDatabase @params | Should -BeSuccessful
}
It 'Should not contain a Cosmos DB SQL database with the given name' {
#arrange
It "Should not contain a Cosmos DB SQL Database named $noSqlDBName" {
# arrange
# The 'ErrorAction = SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
@ -415,31 +418,31 @@ Describe 'Comsos DB SQL Database' {
ErrorAction = "SilentlyContinue"
}
#act
# act and assert
Confirm-AzBPCosmosDBSqlDatabase @params | Should -Not -BeSuccessful
}
It "Should contain a Cosmos DB SQL Database named $sqlDatabaseName in $location" {
#arrange
# arrange
$params = @{
ResourceGroupName = $rgName
AccountName = $sqlAccountName
Name = $sqlDatabaseName
}
#act
# act and assert
Confirm-AzBPCosmosDBSqlDatabase @params | Should -BeInLocation $location
}
It "Should contain a Cosmos DB SQL Database named $sqlDatabaseName in $rgName" {
#arrange
# arrange
$params = @{
ResourceGroupName = $rgName
AccountName = $sqlAccountName
Name = $sqlDatabaseName
}
#act
# act and assert
Confirm-AzBPCosmosDBSqlDatabase @params | Should -BeInResourceGroup $rgName
}
}

Просмотреть файл

@ -11,19 +11,20 @@ Describe 'Verify Data Factory' {
$Script:noDataFactoryName = 'nosampleadf'
}
It 'Should contain a data factory with the given name - Confirm-AzBPResource'{
#arrange
It "Should contain a Data Factory named $dataFactoryName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "DataFactory"
ResourceGroupName = $rgName
ResourceName = $dataFactoryName
}
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a data factory named $dataFactoryName - Confirm-AzBPResource"{
#arrange
It "Should contain a Data Factory named $dataFactoryName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "DataFactory"
ResourceGroupName = $rgName
@ -32,15 +33,15 @@ Describe 'Verify Data Factory' {
PropertyValue = $dataFactoryName
}
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a data factory named $dataFactoryName" {
It "Should contain a Data Factory named $dataFactoryName" {
Confirm-AzBPDataFactory -ResourceGroupName $rgName -Name $dataFactoryName | Should -BeSuccessful
}
It "Should not contain a data factory named $noDataFactoryName" {
#act
It "Should not contain a Data Factory named $noDataFactoryName" {
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
@ -48,11 +49,11 @@ Describe 'Verify Data Factory' {
| Should -Not -BeSuccessful
}
It "Should contain a data factory named $dataFactoryName in $location" {
It "Should contain a Data Factory named $dataFactoryName in $location" {
Confirm-AzBPDataFactory -ResourceGroupName $rgName -Name $dataFactoryName | Should -BeInLocation $location
}
It "Should contain a data factory named $dataFactoryName deployed to $rgName resource group" {
It "Should contain a Data Factory named $dataFactoryName in $rgName" {
Confirm-AzBPDataFactory -ResourceGroupName $rgName -Name $dataFactoryName | Should -BeInResourceGroup $rgName
}
}
@ -62,8 +63,8 @@ Describe 'Verify Data Factory Linked Service' {
$Script:linkedServiceName = 'BenchpressStorageLinkedService'
}
It 'Should contain a data factory with a linked service - Confirm-AzBPResource' {
#arrange
It "Should contain a Data Factory with a Linked Service named $linkedServiceName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = 'DataFactoryLinkedService'
ResourceGroupName = $rgName
@ -71,12 +72,12 @@ Describe 'Verify Data Factory Linked Service' {
ResourceName = $linkedServiceName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It 'Should contain a data factory with a linked service - Confirm-AzBPResource' {
#arrange
It "Should contain a Data Factory with a Linked Service named $linkedServiceName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = 'DataFactoryLinkedService'
ResourceGroupName = $rgName
@ -86,19 +87,19 @@ Describe 'Verify Data Factory Linked Service' {
PropertyValue = $linkedServiceName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a data factory with a linked service named $linkedServiceName" {
#arrange
It "Should contain a Data Factory with a Linked Service named $linkedServiceName" {
# arrange
$params = @{
ResourceGroupName = $rgName
DataFactoryName = $dataFactoryName
Name = $linkedServiceName
}
#act
# act and assert
Confirm-AzBPDataFactoryLinkedService @params | Should -BeSuccessful
}
}

Просмотреть файл

@ -24,8 +24,8 @@ and `Confirm-AzBPDataFactoryLinkedService` cmdlet.
1. Update `DataFactory.Tests.ps1` variables to point to your expected resources:
- `rg-test` -> `your-resource-group-name`
- `westus3` -> `your-data-factory-location`
- `rg-test` -> `your-resource-group-name`
- `westus3` -> `your-data-factory-location`
- `sampleadf` -> `your-data-factory-name`
1. If using a local copy of `Az.InfrastructureTesting`, replace `Import-Module Az.InfrastructureTesting` with

Просмотреть файл

@ -7,13 +7,13 @@
$Script:location = 'westus3'
}
Describe 'Verify EventHub' {
Describe 'Verify Event Hub' {
BeforeAll {
$Script:noEventHub = 'noeventhub'
}
It 'Should contain an eventhub with the given name - Confirm-AzBPResource' {
#arrange
It "Should contain an Event Hub named $eventHubName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "EventHub"
ResourceGroupName = $rgName
@ -21,12 +21,12 @@ Describe 'Verify EventHub' {
NamespaceName = $nameSpaceName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It 'Should contain an eventhub with the expected property name - Confirm-AzBPResource' {
#arrange
It "Should contain an Event Hub named $eventHubName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "EventHub"
ResourceGroupName = $rgName
@ -36,81 +36,82 @@ Describe 'Verify EventHub' {
PropertyValue = $eventHubName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain an EventHub named $eventHubName" {
#arrange
It "Should contain an Event Hub named $eventHubName" {
# arrange
$params = @{
ResourceGroupName = $rgName
NamespaceName = $nameSpaceName
Name = $eventHubName
}
#act
# act and assert
Confirm-AzBPEventHub @params | Should -BeSuccessful
}
It 'Should not contain an eventhub with the given name' {
#arrange
It "Should not contain an Event Hub named $noEventHub" {
# arrange
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
$params = @{
ResourceGroupName = $rgName
NamespaceName = $nameSpaceName
Name = $noEventHub
ErrorAction = "SilentlyContinue"
}
#act
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
Confirm-AzBPEventHub @params -ErrorAction SilentlyContinue | Should -Not -BeSuccessful
# act and assert
Confirm-AzBPEventHub @params | Should -Not -BeSuccessful
}
It "Should contain an EventHub named $eventHubName in $location" {
#arrange
It "Should contain an Event Hub named $eventHubName in $location" {
# arrange
$params = @{
ResourceGroupName = $rgName
NamespaceName = $nameSpaceName
Name = $eventHubName
}
#act
# act and assert
Confirm-AzBPEventHub @params | Should -BeInLocation $location
}
It "Should be in a resource group named $rgName" {
#arrange
It "Should contain an Event Hub named $eventHubName in $rgName" {
# arrange
$params = @{
ResourceGroupName = $rgName
NamespaceName = $nameSpaceName
Name = $eventHubName
}
#act
# act and assert
Confirm-AzBPEventHub @params | Should -BeInResourceGroup $rgName
}
}
Describe 'Verify EventHub Namespace' {
Describe 'Verify Event Hub Namespace' {
BeforeAll {
$Script:noNameSpaceName = 'nosamplenamespace'
}
It 'Should contain an eventhub namespace with the given name - Confirm-AzBPResource' {
#arrange
It "Should contain an Event Hub Namespace named $nameSpaceName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "EventHubNamespace"
ResourceGroupName = $rgName
ResourceName = $nameSpaceName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It 'Should contain an eventhub namespace with the expected property name - Confirm-AzBPResource' {
#arrange
It "Should contain an Event Hub Namespace named $nameSpaceName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "EventHubNamespace"
ResourceGroupName = $rgName
@ -119,17 +120,15 @@ Describe 'Verify EventHub Namespace' {
PropertyValue = $nameSpaceName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain an EventHub Namespace named $nameSpaceName" {
#act
It "Should contain an Event Hub Namespace named $nameSpaceName" {
Confirm-AzBPEventHubNamespace -NamespaceName $namespaceName -ResourceGroupName $rgName | Should -BeSuccessful
}
It 'Should not contain an eventhub namespace with the given name' {
#act
It "Should not contain an Event Hub Namespace named $noNameSpaceName" {
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
@ -137,25 +136,25 @@ Describe 'Verify EventHub Namespace' {
| Should -Not -BeSuccessful
}
It "Should contain an EventHub Namespace named $nameSpace in $location" {
It "Should contain an Event Hub Namespace named $nameSpaceName in $location" {
Confirm-AzBPEventHubNamespace -NamespaceName $namespaceName -ResourceGroupName $rgName
| Should -BeInLocation $location
}
It "Should be in a resource group named $rgName" {
It "Should contain an Event Hub Namespace named $nameSpaceName in $rgName" {
Confirm-AzBPEventHubNamespace -NamespaceName $namespaceName -ResourceGroupName $rgName
| Should -BeInResourceGroup $rgName
}
}
Describe 'Verify EventHub Consumer Group' {
Describe 'Verify Event Hub Consumer Group' {
BeforeAll {
$Script:consumerGroupName = 'eventhubconsumergroup'
$Script:noConsumerGroupName = 'noeventhubconsumergroup'
}
It 'Should contain an eventhub consumer group with the given name - Confirm-AzBPResource' {
#arrange
It "Should contain an Event Hub Consumer Group named $consumerGroupName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "EventHubConsumerGroup"
ResourceGroupName = $rgName
@ -164,12 +163,12 @@ Describe 'Verify EventHub Consumer Group' {
EventHubName = $eventHubName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It 'Should contain an eventhub consumer group with the expected property name - Confirm-AzBPResource' {
#arrange
It "Should contain an Event Hub Consumer Group named $consumerGroupName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "EventHubConsumerGroup"
ResourceGroupName = $rgName
@ -180,12 +179,12 @@ Describe 'Verify EventHub Consumer Group' {
PropertyValue = $consumerGroupName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain an EventHub consumer group named $consumerGroupName" {
#arrange
It "Should contain an Event Hub Consumer Group named $consumerGroupName" {
# arrange
$params = @{
ResourceGroupName = $rgName
NamespaceName = $nameSpaceName
@ -193,28 +192,29 @@ Describe 'Verify EventHub Consumer Group' {
Name = $consumerGroupName
}
#act
# act and assert
Confirm-AzBPEventHubConsumerGroup @params | Should -BeSuccessful
}
It 'Should not contain an eventhub consumer group with the given name' {
#arrange
It "Should not contain an Event Hub Consumer Group named $noConsumerGroupName" {
# arrange
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
$params = @{
ResourceGroupName = $rgName
NamespaceName = $nameSpaceName
EventHubName = $eventHubName
Name = $noConsumerGroupName
ErrorAction = "SilentlyContinue"
}
#act
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
Confirm-AzBPEventHubConsumerGroup @params -ErrorAction SilentlyContinue | Should -Not -BeSuccessful
# act and assert
Confirm-AzBPEventHubConsumerGroup @params | Should -Not -BeSuccessful
}
It "Should contain an EventHub consumer group named $consumerGroupName in $location" {
#arrange
It "Should contain an Event Hub Consumer Group named $consumerGroupName in $location" {
# arrange
$params = @{
ResourceGroupName = $rgName
NamespaceName = $nameSpaceName
@ -222,12 +222,12 @@ Describe 'Verify EventHub Consumer Group' {
Name = $consumerGroupName
}
#act
# act and assert
Confirm-AzBPEventHubConsumerGroup @params | Should -BeInLocation $location
}
It "Should be in a resource group named $rgName" {
#arrange
It "Should contain an Event Hub Consumer Group named $consumerGroupName in $rgName" {
# arrange
$params = @{
ResourceGroupName = $rgName
NamespaceName = $nameSpaceName
@ -235,7 +235,7 @@ Describe 'Verify EventHub Consumer Group' {
Name = $consumerGroupName
}
#act
# act and assert
Confirm-AzBPEventHubConsumerGroup @params | Should -BeInResourceGroup $rgName
}
}

Просмотреть файл

@ -24,11 +24,11 @@ and `Confirm-AzBPEventHubNamespace` cmdlet.
1. Update `EventHub.Tests.ps1` variables to point to your expected resources:
- `rg-test` -> `your-resource-group-name`
- `eventhub` -> `your-eventhub-name`
- `eventhubamespace` -> `your-eventhub-namespace-name`
- `rg-test` -> `your-resource-group-name`
- `eventhub` -> `your-eventhub-name`
- `eventhubamespace` -> `your-eventhub-namespace-name`
- `eventhubconsumergroup` -> `your-eventhub-consumer-group-name`
- `westus3` -> `your-eventhub-location`
- `westus3` -> `your-eventhub-location`
1. If using a local copy of `Az.InfrastructureTesting`, replace `Import-Module Az.InfrastructureTesting` with
`Import-Module "../../bin/BenchPress.Azure.psd1"`. Note that the final `AfterAll` step will properly remove the module

Просмотреть файл

@ -6,7 +6,7 @@
$Script:location = 'westus3'
}
Describe 'Verify KeyVault' {
Describe 'Verify Key Vault' {
BeforeAll {
$Script:noKvName = 'nokvbenchpresstest'
$Script:kvKeyName = 'samplekey'
@ -15,14 +15,15 @@ Describe 'Verify KeyVault' {
$Script:kvAccessPolicyObjectId = 'svcprinoid'
}
It 'Should contain a keyVault with given name - Confirm-AzBPResource' {
#arrange
It "Should contain a Key Vault named $kvName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "KeyVault"
ResourceGroupName = $rgName
ResourceName = $kvName
}
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
@ -37,27 +38,27 @@ Describe 'Verify KeyVault' {
PropertyValue = $kvAccessPolicyObjectId
}
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a KeyVault named $kvName" {
It "Should contain a Key Vault named $kvName" {
Confirm-AzBPKeyVault -ResourceGroupName $rgName -Name $kvName | Should -BeSuccessful
}
It "Should contain a Key named $kvKeyName in the KeyVault with the given name" {
It "Should contain a Key named $kvKeyName in the Key Vault named $kvName" {
Confirm-AzBPKeyVaultKey -KeyVaultName $kvName -Name $kvKeyName | Should -BeSuccessful
}
It "Should contain a Secret named $kvSecretName in the KeyVault with the given name" {
It "Should contain a Secret named $kvSecretName in the Key Vault named $kvName" {
Confirm-AzBPKeyVaultSecret -KeyVaultName $kvName -Name $kvSecretName | Should -BeSuccessful
}
It "Should contain a Certificate named $kvCertificateName in the KeyVault with the given name" {
It "Should contain a Certificate named $kvCertificateName in the Key Vault named $kvName" {
Confirm-AzBPKeyVaultCertificate -KeyVaultName $kvName -Name $kvCertificateName | Should -BeSuccessful
}
It 'Should not contain a KeyVault with the given name' {
#act
It "Should not contain a Key Vault named $noKvName" {
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
@ -65,11 +66,11 @@ Describe 'Verify KeyVault' {
| Should -Not -BeSuccessful
}
It "Should contain a KeyVault named $kvName in $location" {
It "Should contain a Key Vault named $kvName in $location" {
Confirm-AzBPKeyVault -ResourceGroupName $rgName -Name $kvName | Should -BeInLocation $location
}
It "Should be a KeyVault in a resource group named $rgName" {
It "Should contain a Key Vault named $kvName in $rgName" {
Confirm-AzBPKeyVault -ResourceGroupName $rgName -Name $kvName | Should -BeInResourceGroup $rgName
}
}

Просмотреть файл

@ -11,21 +11,21 @@ Describe 'Verify Operational Insights Workspace Exists' {
$Script:noOiwName = 'noOiwName'
}
It 'Should contain a Operational Insights Workspace with given name - Confirm-AzBPResource' {
#arrange
It "Should contain an Operational Insights Workspace named $oiwName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "OperationalInsightsWorkspace"
ResourceGroupName = $rgName
ResourceName = $oiwName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It 'Should contain a Operational Insights Workspace with expected property name - Confirm-AzBPResource' {
#arrange
It "Should contain an Operational Insights Workspace named $oiwName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "OperationalInsightsWorkspace"
ResourceGroupName = $rgName
@ -34,16 +34,16 @@ Describe 'Verify Operational Insights Workspace Exists' {
PropertyValue = $oiwName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Operational Insights Workspace named $oiwName" {
It "Should contain an Operational Insights Workspace named $oiwName" {
Confirm-AzBPOperationalInsightsWorkspace -ResourceGroupName $rgName -Name $oiwName | Should -BeSuccessful
}
It "Should not contain an Operational Insights Workspace named $noOiwName" {
#arrange
# arrange
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
@ -53,15 +53,15 @@ Describe 'Verify Operational Insights Workspace Exists' {
ErrorAction = "SilentlyContinue"
}
#act and asssert
# act and asssert
Confirm-AzBPOperationalInsightsWorkspace @params | Should -Not -BeSuccessful
}
It "Should contain a Operational Insights Workspace named $oiwName in $location" {
It "Should contain an Operational Insights Workspace named $oiwName in $location" {
Confirm-AzBPOperationalInsightsWorkspace -ResourceGroupName $rgName -Name $oiwName | Should -BeInLocation $location
}
It "Should be a Operational Insights Workspace in a resource group named $rgName" {
It "Should contain an Operational Insights Workspace named $oiwName in $rgName" {
Confirm-AzBPOperationalInsightsWorkspace -ResourceGroupName $rgName -Name $oiwName
| Should -BeInResourceGroup $rgName
}

Просмотреть файл

@ -26,6 +26,7 @@ cmdlet.
- `rg-test` -> `your-resource-group-name`
- `oiwName` -> `your-operational-insights-workspace-name`
- `westus3` -> `your-operational-insights-location`
1. If using a local copy of `Az.InfrastructureTesting`, replace `Import-Module Az.InfrastructureTesting` with
`Import-Module "../../bin/BenchPress.Azure.psd1"`. Note that the final `AfterAll` step will properly remove the module

Просмотреть файл

@ -10,19 +10,20 @@ Describe 'Verify Resource Group Exists' {
$Script:noRgName = 'notestrg'
}
It 'Should contain a resource group with given name - Confirm-AzBPResource' {
#arrange
It "Should contain a Resource Group named $rgName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "ResourceGroup"
ResourceName = $rgName
}
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It 'Should contain a resource group with expected property name - Confirm-AzBPResource' {
#arrange
It "Should contain a Resource Group named $rgName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "ResourceGroup"
ResourceName = $rgName
@ -30,21 +31,22 @@ Describe 'Verify Resource Group Exists' {
PropertyValue = $rgName
}
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a resource group named $rgName" {
It "Should contain a Resource Group named $rgName" {
Confirm-AzBPResourceGroup -ResourceGroupName $rgName | Should -BeSuccessful
}
It "Should not contain a resource group named $noRgName" {
It "Should not contain a Resource Group named $noRgName" {
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
Confirm-AzBPResourceGroup -ResourceGroupName $noRgName -ErrorAction SilentlyContinue | Should -Not -BeSuccessful
}
It "Should contain an Resource Group named $rgName in $location" {
It "Should contain a Resource Group named $rgName in $location" {
Confirm-AzBPResourceGroup -ResourceGroupName $rgName | Should -BeInLocation $location
}
}

Просмотреть файл

@ -23,8 +23,8 @@
1. Update `ResourceGroup.Tests.ps1` variables to point to your expected resources:
- `rgtest` -> `your-resource-group-name`
- `notRgName` -> `not-your-resource-group-name`
- `rg-test` -> `your-resource-group-name`
- `westus3` -> `your-resource-group-location`
1. If using a local copy of `Az.InfrastructureTesting`, replace `Import-Module Az.InfrastructureTesting` with
`Import-Module "../../bin/BenchPress.Azure.psd1"`. Note that the final `AfterAll` step will properly remove the module

Просмотреть файл

@ -11,8 +11,8 @@ Describe 'Verify Role Assignment Exists' {
$Script:noRoleName = 'Owner'
}
It "Should have a Service Principal with $roleName Role - Confirm-AzBPResource" {
#act
It "Should contain a Service Principal with $roleName Role - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = 'RoleAssignment'
ServicePrincipalId = $principalId
@ -20,12 +20,12 @@ Describe 'Verify Role Assignment Exists' {
Scope = $scope
}
#assert
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should have a Service Principal with $roleName Role - Confirm-AzBPResource" {
#act
It "Should contain a Service Principal with $roleName Role - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = 'RoleAssignment'
ServicePrincipalId = $principalId
@ -35,19 +35,19 @@ Describe 'Verify Role Assignment Exists' {
PropertyValue = $roleName
}
#assert
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should not have a Service Principal with $noRoleName Role" {
#act
It "Should not contain a Service Principal with $noRoleName Role" {
# arrange
$params = @{
ServicePrincipalId = $principalId
RoleDefinitionName = $noRoleName
Scope = $scope
}
#assert
# act and assert
Confirm-AzBPRoleAssignment @params | Should -Not -BeSuccessful
}

Просмотреть файл

@ -7,13 +7,13 @@
$Script:databaseName = 'samplesqldatabase'
}
Describe 'Verify Sql Database' {
Describe 'Verify SQL Database' {
BeforeAll {
$Script:noDatabaseName = 'nosamplesqlserver'
}
It 'Should contain a sql database with given name - Confirm-AzBPResource' {
#arrange
It "Should contain a SQL Database named $databaseName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "SqlDatabase"
ResourceName = $databaseName
@ -21,13 +21,13 @@ Describe 'Verify Sql Database' {
ServerName = $serverName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It 'Should contain a sql database with expected property name - Confirm-AzBPResource' {
#arrange
It "Should contain a SQL Database named $databaseName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "SqlDatabase"
ResourceName = $databaseName
@ -37,21 +37,24 @@ Describe 'Verify Sql Database' {
PropertyValue = $databaseName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Sql Database named $databaseName" {
It "Should contain a SQL Database named $databaseName" {
# arrange
$params = @{
ResourceGroupName = $rgName
DatabaseName = $databaseName
ServerName = $serverName
DatabaseName = $databaseName
ServerName = $serverName
}
# act and assert
Confirm-AzBPSqlDatabase @params | Should -BeSuccessful
}
It 'Should not contain a Sql Database with the given name' {
It "Should not contain a SQL Database named $noDatabaseName" {
# arrange
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
@ -62,26 +65,31 @@ Describe 'Verify Sql Database' {
ErrorAction = "SilentlyContinue"
}
# act and asssert
Confirm-AzBPSqlDatabase @params | Should -Not -BeSuccessful
}
It "Should contain a Sql Database named $databaseName in $location" {
It "Should contain a SQL Database named $databaseName in $location" {
# arrange
$params = @{
ResourceGroupName = $rgName
DatabaseName = $databaseName
ServerName = $serverName
DatabaseName = $databaseName
ServerName = $serverName
}
# act and assert
Confirm-AzBPSqlDatabase @params | Should -BeInLocation $location
}
It "Should be a Sql Database in a resource group named $rgName" {
It "Should contain a SQL Database named $databaseName in $rgName" {
# arrange
$params = @{
ResourceGroupName = $rgName
DatabaseName = $databaseName
ServerName = $serverName
DatabaseName = $databaseName
ServerName = $serverName
}
# act and assert
Confirm-AzBPSqlDatabase @params | Should -BeInResourceGroup $rgName
}
}

Просмотреть файл

@ -25,10 +25,10 @@
1. Update `SqlDatabase.Tests.ps1` variables to point to your expected resources:
- `rg-test` -> `your-resource-group-name`
- `samplesqlserver` -> `your-sql-server-name`
- `rg-test` -> `your-resource-group-name`
- `samplesqlserver` -> `your-sql-server-name`
- `samplesqldatabase` -> `your-sql-db-name`
- `westus3` -> `your-sql-database-location`
- `westus3` -> `your-sql-database-location`
1. If using a local copy of `Az.InfrastructureTesting`, replace `Import-Module Az.InfrastructureTesting` with
`Import-Module "../../bin/BenchPress.Azure.psd1"`. Note that the final `AfterAll` step will properly remove the module

Просмотреть файл

@ -6,26 +6,26 @@
$Script:serverName = 'samplesqlserver'
}
Describe 'Verify Sql Server' {
Describe 'Verify SQL Server' {
BeforeAll {
$Script:noServerName = 'nosamplesqlserver'
}
It 'Should contain a sql server with given name - Confirm-AzBPResource' {
#arrange
It "Should contain a SQL Server named $serverName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "SqlServer"
ResourceName = $serverName
ResourceGroupName = $rgName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It 'Should contain a sql server with expected property name - Confirm-AzBPResource' {
#arrange
It "Should contain a SQL Server named $serverName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "SqlServer"
ResourceName = $serverName
@ -34,15 +34,15 @@ Describe 'Verify Sql Server' {
PropertyValue = $serverName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Sql Server named $serverName" {
It "Should contain a SQL Server named $serverName" {
Confirm-AzBPSqlServer -ResourceGroupName $rgName -ServerName $serverName | Should -BeSuccessful
}
It 'Should not contain a Sql Server with the given name' {
It "Should not contain a SQL Server named $noServerName" {
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
@ -50,11 +50,11 @@ Describe 'Verify Sql Server' {
| Should -Not -BeSuccessful
}
It "Should contain a Sql Server named $serverName in $location" {
It "Should contain a SQL Server named $serverName in $location" {
Confirm-AzBPSqlServer -ResourceGroupName $rgName -ServerName $serverName | Should -BeInLocation $location
}
It "Should be a Sql Server in a resource group named $rgName" {
It "Should contain a SQL Server named $serverName in $rgName" {
Confirm-AzBPSqlServer -ResourceGroupName $rgName -ServerName $serverName | Should -BeInResourceGroup $rgName
}
}

Просмотреть файл

@ -25,9 +25,9 @@
1. Update `SqlServer.Tests.ps1` variables to point to your expected resources:
- `rg-test` -> `your-resource-group-name`
- `rg-test` -> `your-resource-group-name`
- `samplesqlserver` -> `your-sql-server-name`
- `westus3` -> `your-sql-server-location`
- `westus3` -> `your-sql-server-location`
1. If using a local copy of `Az.InfrastructureTesting`, replace `Import-Module Az.InfrastructureTesting` with
`Import-Module "../../bin/BenchPress.Azure.psd1"`. Note that the final `AfterAll` step will properly remove the module

Просмотреть файл

@ -11,29 +11,29 @@ Describe 'Verify Storage Account' {
$Script:noAccountName = 'noazbenchpressstorage'
}
It 'Should contain a Storage Account with the given name - Confirm-AzBPResource' {
#arrange
It "Should contain a Storage Account named $accountName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "StorageAccount"
ResourceType = "StorageAccount"
ResourceGroupName = $rgName
ResourceName = $accountName
ResourceName = $accountName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Storage Account named $accountName - ConfirmAzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "StorageAccount"
ResourceType = "StorageAccount"
ResourceGroupName = $rgName
ResourceName = $accountName
PropertyKey = 'StorageAccountName'
PropertyValue = $accountName
ResourceName = $accountName
PropertyKey = 'StorageAccountName'
PropertyValue = $accountName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
@ -41,8 +41,7 @@ Describe 'Verify Storage Account' {
Confirm-AzBPStorageAccount -ResourceGroupName $rgName -Name $accountName | Should -BeSuccessful
}
It 'Should not contain a Storage Account with the given name' {
#act
It "Should not contain a Storage Account named $noAccountName" {
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
@ -54,7 +53,7 @@ Describe 'Verify Storage Account' {
Confirm-AzBPStorageAccount -ResourceGroupName $rgName -Name $accountName | Should -BeInLocation $location
}
It "Should be a Storage Account in a resource group named $rgName" {
It "Should contain a Storage Account named $accountName in $rgName" {
Confirm-AzBPStorageAccount -ResourceGroupName $rgName -Name $accountName | Should -BeInResourceGroup $rgName
}
}
@ -65,48 +64,51 @@ Describe 'Verify Storage Container' {
$Script:noContainerName = 'noazbenchpresscontainer'
}
It 'Should contain a Storage Container with the given name - Confirm-AzBPResource' {
#arrange
It "Should contain a Storage Container named $containerName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "StorageContainer"
ResourceType = "StorageContainer"
ResourceGroupName = $rgName
AccountName = $accountName
ResourceName = $containerName
AccountName = $accountName
ResourceName = $containerName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Storage Container named $containerName - ConfirmAzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "StorageContainer"
ResourceType = "StorageContainer"
ResourceGroupName = $rgName
AccountName = $accountName
ResourceName = $containerName
PropertyKey = 'Name'
PropertyValue = $containerName
AccountName = $accountName
ResourceName = $containerName
PropertyKey = 'Name'
PropertyValue = $containerName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Storage Container named $containerName" {
#arrange
# arrange
$params = @{
ResourceGroupName = $rgName
AccountName = $accountName
Name = $containerName
}
#act
# act and assert
Confirm-AzBPStorageContainer @params | Should -BeSuccessful
}
It "Should not contain a Storage Container with the given name" {
#arrange
It "Should not contain a Storage Container named $noContainerName" {
# arrange
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
$params = @{
ResourceGroupName = $rgName
AccountName = $accountName
@ -114,10 +116,7 @@ Describe 'Verify Storage Container' {
ErrorAction = "SilentlyContinue"
}
#act
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
# act and assert
Confirm-AzBPStorageContainer @params | Should -Not -BeSuccessful
}
}

Просмотреть файл

@ -10,29 +10,29 @@ Describe 'Verify Stream Analytics Cluster' {
$Script:clusterName = 'teststreamcluster'
}
It 'Should contain a Stream Analytics Cluster with the given name - Confirm-AzBPResource' {
#arrange
It "Should contain a Stream Analytics Cluster named $clusterName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "StreamAnalyticsCluster"
ResourceType = "StreamAnalyticsCluster"
ResourceGroupName = $rgName
ResourceName = $clusterName
ResourceName = $clusterName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Stream Analytics Cluster named $clusterName - ConfirmAzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "StreamAnalyticsCluster"
ResourceType = "StreamAnalyticsCluster"
ResourceGroupName = $rgName
ResourceName = $clusterName
PropertyKey = 'Name'
PropertyValue = $clusterName
ResourceName = $clusterName
PropertyKey = 'Name'
PropertyValue = $clusterName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
@ -44,7 +44,7 @@ Describe 'Verify Stream Analytics Cluster' {
Confirm-AzBPStreamAnalyticsCluster -ResourceGroupName $rgName -Name $clusterName | Should -BeInLocation $location
}
It "Should be a Stream Analytics Cluster in a resource group named $rgName" {
It "Should contain a Stream Analytics Cluster named $clusterName in $rgName" {
Confirm-AzBPStreamAnalyticsCluster -ResourceGroupName $rgName -Name $clusterName
| Should -BeInResourceGroup $rgName
}
@ -59,29 +59,29 @@ Describe 'Stream Analytics Jobs' {
$Script:transformationName = 'testtransformation'
}
It 'Should contain a Stream Analytics Job with the given name - Confirm-AzBPResource' {
#arrange
It "Should contain a Stream Analytics Job named $jobName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "StreamAnalyticsJob"
ResourceType = "StreamAnalyticsJob"
ResourceGroupName = $rgName
ResourceName = $jobName
ResourceName = $jobName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Stream Analytics Job named $jobName - ConfirmAzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "StreamAnalyticsJob"
ResourceType = "StreamAnalyticsJob"
ResourceGroupName = $rgName
ResourceName = $jobName
PropertyKey = 'Name'
PropertyValue = $jobName
ResourceName = $jobName
PropertyKey = 'Name'
PropertyValue = $jobName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
@ -93,223 +93,223 @@ Describe 'Stream Analytics Jobs' {
Confirm-AzBPStreamAnalyticsJob -ResourceGroupName $rgName -Name $jobName | Should -BeInLocation $location
}
It "Should be a Stream Analytics Job in a resource group named $rgName" {
It "Should contain a Stream Analytics Job named $jobName in $rgName" {
Confirm-AzBPStreamAnalyticsJob -ResourceGroupName $rgName -Name $jobName | Should -BeInResourceGroup $rgName
}
#######################################################################################################################
It 'Should contain a Stream Analytics Function with the given name - Confirm-AzBPResource' {
#arrange
It "Should contain a Stream Analytics Function named $functionName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "StreamAnalyticsFunction"
ResourceType = "StreamAnalyticsFunction"
ResourceGroupName = $rgName
JobName = $jobName
ResourceName = $functionName
JobName = $jobName
ResourceName = $functionName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Stream Analytics Function named $functionName - ConfirmAzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "StreamAnalyticsFunction"
ResourceType = "StreamAnalyticsFunction"
ResourceGroupName = $rgName
JobName = $jobName
ResourceName = $functionName
PropertyKey = 'Name'
PropertyValue = $functionName
JobName = $jobName
ResourceName = $functionName
PropertyKey = 'Name'
PropertyValue = $functionName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Stream Analytics Function named $functionName" {
#arrange
# arrange
$params = @{
ResourceGroupName = $rgName
JobName = $jobName
Name = $functionName
JobName = $jobName
Name = $functionName
}
#act
# act and assert
Confirm-AzBPStreamAnalyticsFunction @params | Should -BeSuccessful
}
It "Should be a Stream Analytics Function in a resource group named $rgName" {
#arrange
It "Should contain a Stream Analytics Function named $functionName in $rgName" {
# arrange
$params = @{
ResourceGroupName = $rgName
JobName = $jobName
Name = $functionName
JobName = $jobName
Name = $functionName
}
#act
# act and assert
Confirm-AzBPStreamAnalyticsFunction @params | Should -BeInResourceGroup $rgName
}
#######################################################################################################################
It 'Should contain a Stream Analytics Input with the given name - Confirm-AzBPResource' {
#arrange
It "Should contain a Stream Analytics Input named $inputName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "StreamAnalyticsInput"
ResourceType = "StreamAnalyticsInput"
ResourceGroupName = $rgName
JobName = $jobName
ResourceName = $inputName
JobName = $jobName
ResourceName = $inputName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Stream Analytics Input named $inputName - ConfirmAzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "StreamAnalyticsInput"
ResourceType = "StreamAnalyticsInput"
ResourceGroupName = $rgName
JobName = $jobName
ResourceName = $inputName
PropertyKey = 'Name'
PropertyValue = $inputName
JobName = $jobName
ResourceName = $inputName
PropertyKey = 'Name'
PropertyValue = $inputName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Stream Analytics Input named $inputName" {
#arrange
# arrange
$params = @{
ResourceGroupName = $rgName
JobName = $jobName
Name = $inputName
JobName = $jobName
Name = $inputName
}
#act
# act and assert
Confirm-AzBPStreamAnalyticsInput @params | Should -BeSuccessful
}
It "Should be a Stream Analytics Input in a resource group named $rgName" {
#arrange
It "Should contain a Stream Analytics Input named $inputName in $rgName" {
# arrange
$params = @{
ResourceGroupName = $rgName
JobName = $jobName
Name = $inputName
JobName = $jobName
Name = $inputName
}
#act
# act and assert
Confirm-AzBPStreamAnalyticsInput @params | Should -BeInResourceGroup $rgName
}
#######################################################################################################################
It 'Should contain a Stream Analytics Output with the given name - Confirm-AzBPResource' {
#arrange
It "Should contain a Stream Analytics Output named $outputName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "StreamAnalyticsOutput"
ResourceType = "StreamAnalyticsOutput"
ResourceGroupName = $rgName
JobName = $jobName
ResourceName = $outputName
JobName = $jobName
ResourceName = $outputName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Stream Analytics Output named $outputName - ConfirmAzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "StreamAnalyticsOutput"
ResourceType = "StreamAnalyticsOutput"
ResourceGroupName = $rgName
JobName = $jobName
ResourceName = $outputName
PropertyKey = 'Name'
PropertyValue = $outputName
JobName = $jobName
ResourceName = $outputName
PropertyKey = 'Name'
PropertyValue = $outputName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Stream Analytics Output named $outputName" {
#arrange
# arrange
$params = @{
ResourceGroupName = $rgName
JobName = $jobName
Name = $outputName
JobName = $jobName
Name = $outputName
}
#act
# act and assert
Confirm-AzBPStreamAnalyticsOutput @params | Should -BeSuccessful
}
It "Should be a Stream Analytics Output in a resource group named $rgName" {
#arrange
It "Should contain a Stream Analytics Output named $outputName in $rgName" {
# arrange
$params = @{
ResourceGroupName = $rgName
JobName = $jobName
Name = $outputName
JobName = $jobName
Name = $outputName
}
#act
# act and assert
Confirm-AzBPStreamAnalyticsOutput @params | Should -BeInResourceGroup $rgName
}
#######################################################################################################################
It 'Should contain a Stream Analytics Transformation with the given name - Confirm-AzBPResource' {
#arrange
It "Should contain a Stream Analytics Transformation named $transformationName- Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "StreamAnalyticsTransformation"
ResourceType = "StreamAnalyticsTransformation"
ResourceGroupName = $rgName
JobName = $jobName
ResourceName = $transformationName
JobName = $jobName
ResourceName = $transformationName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Stream Analytics Transformation named $transformationName - ConfirmAzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "StreamAnalyticsTransformation"
ResourceType = "StreamAnalyticsTransformation"
ResourceGroupName = $rgName
JobName = $jobName
ResourceName = $transformationName
PropertyKey = 'Name'
PropertyValue = $transformationName
JobName = $jobName
ResourceName = $transformationName
PropertyKey = 'Name'
PropertyValue = $transformationName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Stream Analytics Transformation named $transformationName" {
#arrange
# arrange
$params = @{
ResourceGroupName = $rgName
JobName = $jobName
Name = $transformationName
JobName = $jobName
Name = $transformationName
}
#act
# act and assert
Confirm-AzBPStreamAnalyticsTransformation @params | Should -BeSuccessful
}
It "Should be a Stream Analytics Transformation in a resource group named $rgName" {
#arrange
It "Should contain a Stream Analytics Transformation named $transformationName in $rgName" {
# arrange
$params = @{
ResourceGroupName = $rgName
JobName = $jobName
Name = $transformationName
JobName = $jobName
Name = $transformationName
}
#act
# act and assert
Confirm-AzBPStreamAnalyticsTransformation @params | Should -BeInResourceGroup $rgName
}
}

Просмотреть файл

@ -11,58 +11,58 @@ Describe 'Verify Synapse Workspace' {
$Script:noWorkspaceName = 'nosamplesynws'
}
It 'Should contain a Synapse Workspace with the given name - Confirm-AzBPResource' {
#arrange
It "Should contain a Synapse Workspace named $workSpaceName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "SynapseWorkspace"
ResourceType = "SynapseWorkspace"
ResourceGroupName = $rgName
ResourceName = $workSpaceName
ResourceName = $workSpaceName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Synapse Workspace named $workSpaceName - ConfirmAzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "SynapseWorkspace"
ResourceType = "SynapseWorkspace"
ResourceGroupName = $rgName
ResourceName = $workSpaceName
PropertyKey = 'Name'
PropertyValue = $workSpaceName
ResourceName = $workSpaceName
PropertyKey = 'Name'
PropertyValue = $workSpaceName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a synapse workspace named $workSpaceName" {
It "Should contain a Synapse Workspace named $workSpaceName" {
Confirm-AzBPSynapseWorkspace -ResourceGroupName $rgName -WorkspaceName $workspaceName | Should -BeSuccessful
}
It "Should contain a synapse workspace named $workSpaceName in $location" {
It "Should contain a Synapse Workspace named $workSpaceName in $location" {
Confirm-AzBPSynapseWorkspace -ResourceGroupName $rgName -WorkspaceName $workspaceName
| Should -BeInLocation $location
}
It "Should contain a synapse workspace named $workSpaceName in $rgName" {
It "Should contain a Synapse Workspace named $workSpaceName in $rgName" {
Confirm-AzBPSynapseWorkspace -ResourceGroupName $rgName -WorkspaceName $workspaceName
| Should -BeInResourceGroup $rgName
}
It "Should not contain a synapse workspace named $noWorkspaceName" {
#act
It "Should not contain a Synapse Workspace named $noWorkspaceName" {
# arrange
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
$params = @{
ResourceGroupName = $rgName
WorkspaceName = $noWorkspaceName
ErrorAction = 'SilentlyContinue'
WorkspaceName = $noWorkspaceName
ErrorAction = 'SilentlyContinue'
}
#act and assert
# act and assert
Confirm-AzBPSynapseWorkspace @params | Should -Not -BeSuccessful
}
}
@ -73,132 +73,132 @@ Describe 'Verify Synapse Spark/SQL Pool' {
$Script:sqlPoolName = 'samplesql'
}
It 'Should contain a Synapse Spark Pool with the given name - Confirm-AzBPResource' {
#arrange
It "Should contain a Synapse Spark Pool named $sparkPoolName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "SynapseSparkPool"
ResourceType = "SynapseSparkPool"
ResourceGroupName = $rgName
WorkspaceName = $workSpaceName
ResourceName = $sparkPoolName
WorkspaceName = $workSpaceName
ResourceName = $sparkPoolName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Synapse Spark Pool named $sparkPoolName - ConfirmAzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "SynapseSparkPool"
ResourceType = "SynapseSparkPool"
ResourceGroupName = $rgName
WorkspaceName = $workSpaceName
ResourceName = $sparkPoolName
PropertyKey = 'Name'
PropertyValue = $sparkPoolName
WorkspaceName = $workSpaceName
ResourceName = $sparkPoolName
PropertyKey = 'Name'
PropertyValue = $sparkPoolName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a synapse workspace with a spark pool named $sparkPoolName" {
#arrange
It "Should contain a Synapse Workspace with a Spark Pool named $sparkPoolName" {
# arrange
$params = @{
ResourceGroupName = $rgName
WorkspaceName = $workSpaceName
SynapseSparkPoolName = $sparkPoolName
}
#act
# act and assert
Confirm-AzBPSynapseSparkPool @params | Should -BeSuccessful
}
It "Should contain a spark pool in $location" {
#arrange
It "Should contain a Spark Pool named $sparkPoolName in $location" {
# arrange
$params = @{
ResourceGroupName = $rgName
WorkspaceName = $workSpaceName
SynapseSparkPoolName = $sparkPoolName
}
#act
# act and assert
Confirm-AzBPSynapseSparkPool @params | Should -BeInLocation $location
}
It "Should contain a spark pool in $rgName" {
#arrange
It "Should contain a Spark Pool named $sparkPoolName in $rgName" {
# arrange
$params = @{
ResourceGroupName = $rgName
WorkspaceName = $workSpaceName
SynapseSparkPoolName = $sparkPoolName
}
#act
# act and assert
Confirm-AzBPSynapseSparkPool @params | Should -BeInResourceGroup $rgName
}
#######################################################################################################################
It 'Should contain a Synapse SQL Pool with the given name - Confirm-AzBPResource' {
#arrange
It "Should contain a Synapse SQL Pool named $sqlPoolName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "SynapseSqlPool"
ResourceType = "SynapseSqlPool"
ResourceGroupName = $rgName
WorkspaceName = $workSpaceName
ResourceName = $sqlPoolName
WorkspaceName = $workSpaceName
ResourceName = $sqlPoolName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Synapse SQL Pool named $sqlPoolName - ConfirmAzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "SynapseSqlPool"
ResourceType = "SynapseSqlPool"
ResourceGroupName = $rgName
WorkspaceName = $workSpaceName
ResourceName = $sqlPoolName
PropertyKey = 'Name'
PropertyValue = $sqlPoolName
WorkspaceName = $workSpaceName
ResourceName = $sqlPoolName
PropertyKey = 'Name'
PropertyValue = $sqlPoolName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a synapse workspace with a SQL pool named $sqlPoolName" {
#arrange
It "Should contain a Synapse Workspace with a SQL Pool named $sqlPoolName" {
# arrange
$params = @{
ResourceGroupName = $rgName
WorkspaceName = $workSpaceName
SynapseSqlPoolName = $sqlPoolName
}
#act
# act and assert
Confirm-AzBPSynapseSqlPool @params | Should -BeSuccessful
}
It "Should contain a SQL pool in $location" {
#arrange
It "Should contain a SQL Pool named $sqlPoolName in $location" {
# arrange
$params = @{
ResourceGroupName = $rgName
WorkspaceName = $workSpaceName
SynapseSqlPoolName = $sqlPoolName
}
#act
# act and assert
Confirm-AzBPSynapseSqlPool @params | Should -BeInLocation $location
}
It "Should contain a SQL pool in $rgName" {
#arrange
It "Should contain a SQL Pool named $sqlPoolName in $rgName" {
# arrange
$params = @{
ResourceGroupName = $rgName
WorkspaceName = $workSpaceName
SynapseSqlPoolName = $sqlPoolName
}
#act
# act and assert
Confirm-AzBPSynapseSqlPool @params | Should -BeInResourceGroup $rgName
}
}

Просмотреть файл

@ -11,29 +11,29 @@ Describe 'Verify Virtual Machine' {
$Script:noVmName = 'noSimpleLinuxVM1'
}
It 'Should contain a Virtual Machine with the given name - Confirm-AzBPResource' {
#arrange
It "Should contain a Virtual Machine named $vmName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "VirtualMachine"
ResourceType = "VirtualMachine"
ResourceGroupName = $rgName
ResourceName = $vmName
ResourceName = $vmName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Virtual Machine named $vmName - ConfirmAzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "VirtualMachine"
ResourceType = "VirtualMachine"
ResourceGroupName = $rgName
ResourceName = $vmName
PropertyKey = 'Name'
PropertyValue = $vmName
ResourceName = $vmName
PropertyKey = 'Name'
PropertyValue = $vmName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
@ -41,26 +41,26 @@ Describe 'Verify Virtual Machine' {
Confirm-AzBPVirtualMachine -ResourceGroupName $rgName -VirtualMachineName $vmName | Should -BeSuccessful
}
It 'Should not contain a Virtual Machine with the given name' {
#arrange
$params = @{
ResourceGroupName = $rgName
VirtualMachineName = $noVmName
ErrorAction = "SilentlyContinue"
}
#act
It "Should not contain a Virtual Machine named $noVmName" {
# arrange
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
$params = @{
ResourceGroupName = $rgName
VirtualMachineName = $noVmName
ErrorAction = "SilentlyContinue"
}
# act and assert
Confirm-AzBPVirtualMachine @params | Should -Not -BeSuccessful
}
It "Should contain an Virtual Machine named $vmName in $location" {
It "Should contain a Virtual Machine named $vmName in $location" {
Confirm-AzBPVirtualMachine -ResourceGroupName $rgName -VirtualMachineName $vmName | Should -BeInLocation $location
}
It "Should be a Virtual Machine in a resource group named $rgName" {
It "Should contain a Virtual Machine named $vmName in $rgName" {
Confirm-AzBPVirtualMachine -ResourceGroupName $rgName -VirtualMachineName $vmName
| Should -BeInResourceGroup $rgName
}

Просмотреть файл

@ -11,29 +11,29 @@ Describe 'Verify Web App Exists' {
$Script:noWebAppName = 'noazbpwebapptest'
}
It 'Should contain a Web App with the given name - Confirm-AzBPResource' {
#arrange
It "Should contain a Web App named $webappName - Confirm-AzBPResource" {
# arrange
$params = @{
ResourceType = "WebApp"
ResourceType = "WebApp"
ResourceGroupName = $rgName
ResourceName = $webappName
ResourceName = $webappName
}
#act
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
It "Should contain a Web App named $webappName - ConfirmAzBPResource" {
#arrange
# arrange
$params = @{
ResourceType = "WebApp"
ResourceType = "WebApp"
ResourceGroupName = $rgName
ResourceName = $webappName
PropertyKey = 'Name'
PropertyValue = $webappName
ResourceName = $webappName
PropertyKey = 'Name'
PropertyValue = $webappName
}
#act and assert
# act and assert
Confirm-AzBPResource @params | Should -BeSuccessful
}
@ -41,7 +41,7 @@ Describe 'Verify Web App Exists' {
Confirm-AzBPWebApp -ResourceGroupName $rgName -WebAppName $webappName | Should -BeSuccessful
}
It 'Should not contain a Web App with the given name' {
It "Should not contain a Web App named $noWebappName" {
# The '-ErrorAction SilentlyContinue' command suppresses all errors.
# In this test, it will suppress the error message when a resource cannot be found.
# Remove this field to see all errors.
@ -53,7 +53,7 @@ Describe 'Verify Web App Exists' {
Confirm-AzBPWebApp -ResourceGroupName $rgName -WebAppName $webappName | Should -BeInLocation $location
}
It "Should be a Web App in a resource group named $rgName" {
It "Should contain a Web App named $webappName in $rgName" {
Confirm-AzBPWebApp -ResourceGroupName $rgName -WebAppName $webappName | Should -BeInResourceGroup $rgName
}
}