This repository has been archived by the owner on Feb 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Numerous changes to automated testing
Numerous changes to automated testing and added code of conduct to readme
- Loading branch information
powershellshock
committed
Jun 13, 2016
1 parent
fd5c525
commit 2485f4f
Showing
4 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
If (Get-Module Cloud-App-Security) {Remove-Module Cloud-App-Security} | ||
$ScriptPath = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition | ||
Import-Module "$ScriptPath\Cloud-App-Security.psm1" | ||
|
||
#$CASCredential = Import-Clixml C:\Users\jpoeppel\mod102677.credential | ||
|
||
|
||
# Initialize | ||
$ErrorAction = 'Continue' | ||
$CountTests = @() | ||
|
||
|
||
$OverallSuccess = $true | ||
|
||
|
||
#region ---------- Count Tests ---------- | ||
|
||
$CountTests += New-Object PSObject -Property @{'Test'={Get-CASAccount -ResultSetSize 1};'ExpectedCount'=1;'ResultCount'=$null} | ||
$CountTests += New-Object PSObject -Property @{'Test'={Get-CASAccount -ResultSetSize 2};'ExpectedCount'=2;'ResultCount'=$null} | ||
|
||
$CountTests += New-Object PSObject -Property @{'Test'={Get-CASActivity -ResultSetSize 1};'ExpectedCount'=1;'ResultCount'=$null} | ||
$CountTests += New-Object PSObject -Property @{'Test'={Get-CASActivity -ResultSetSize 2};'ExpectedCount'=2;'ResultCount'=$null} | ||
|
||
$CountTests += New-Object PSObject -Property @{'Test'={Get-CASAlert -ResultSetSize 1};'ExpectedCount'=1;'ResultCount'=$null} | ||
$CountTests += New-Object PSObject -Property @{'Test'={Get-CASAlert -ResultSetSize 2};'ExpectedCount'=2;'ResultCount'=$null} | ||
|
||
$CountTests += New-Object PSObject -Property @{'Test'={Get-CASFile -ResultSetSize 1};'ExpectedCount'=1;'ResultCount'=$null} | ||
$CountTests += New-Object PSObject -Property @{'Test'={Get-CASFile -ResultSetSize 2};'ExpectedCount'=2;'ResultCount'=$null} | ||
|
||
#endregion ---------- Count Tests ---------- | ||
|
||
|
||
ForEach ($t in $CountTests) | ||
{ | ||
$t.ResultCount = ((&($t.Test) | Measure-Object).Count) | ||
|
||
If ($t.ResultCount -ne $t.ExpectedCount) | ||
{ | ||
$OverallSuccess = $false | ||
Write-Warning $t | ||
} | ||
} | ||
|
||
Write-Output $OverallSuccess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# Cloud-App-Security | ||
Powershell module for Microsoft Cloud App Security | ||
|
||
This project has adopted the [Microsoft Open Source Code of Conduct](http://microsoft.github.io/codeofconduct). For more information see the [Code of Conduct FAQ](http://microsoft.github.io/codeofconduct/faq.md) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
$Passed = $True | ||
|
||
#If (!(.\Invoke-CASModuleErrorTests.ps1)) {$Passed = $false} | ||
If (!(.\Invoke-CASModuleResultCountTests.ps1)) {$Passed = $false} | ||
|
||
If ($Passed) {Write-Host -ForegroundColor Green "All tests passed."} | ||
Else {Write-Host -ForegroundColor Yellow "One or more tests failed!"} | ||
|
||
Read-Host -Prompt 'Testing complete, press Enter to close' |