-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Fix GetType() bad pattern and related issues in tests #3134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1194,7 +1194,7 @@ try { | |
|
|
||
| It "Verify type returned by Get-ComputerInfo" { | ||
| $computerInfo = Get-ComputerInfo | ||
| $computerInfo.GetType().Name | Should Be "ComputerInfo" | ||
| $computerInfo | Should BeOfType Microsoft.PowerShell.Commands.ComputerInfo | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -1331,9 +1331,9 @@ try { | |
| ($observed.OsFreeVirtualMemory -gt 0) | Should Be $true | ||
| } | ||
|
|
||
| It "(special case) Test for property = OsLocalDateTime" { | ||
| It "(special case) Test for property = OsLocalDateTime" -Pending:$true { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it failing? If it is we better have an issue tracking it.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OsLocalDateTime return empty to me. And the test is wrong. Yes, we should open a new Issue...
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup, the test doesn't do anything about
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done #3146 |
||
| $computerInfo = Get-ComputerInfo | ||
| $computerInfo.GetType().Name | Should Be "ComputerInfo" | ||
| $computerInfo | Should BeOfType "ComputerInfo" | ||
| } | ||
|
|
||
| It "(special case) Test for property = OsMaxNumberOfProcesses" { | ||
|
|
@@ -1356,7 +1356,7 @@ try { | |
| It "(special case) Test for Filter Property - Property filter with special wild card * and fixed" { | ||
| $propertyFilter = @("BiosC*","*") | ||
| $computerInfo = Get-ComputerInfo -Property $propertyFilter | ||
| $computerInfo.GetType().Name | Should Be "ComputerInfo" | ||
| $computerInfo | Should BeOfType Microsoft.PowerShell.Commands.ComputerInfo | ||
| } | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be
$_.Exception | Should BeOfType $exception?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't work 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what is happening. $exception is point to internal types, and thus Pester cannot resolve. #Closed