Three Issues with "AboutSelectObject.Koans.ps1" #339
Labels
Category-Koans
Invoking the Great Doubt
Issue-Bug 🐛
Something's wrong!
Issue-Enhancement 🎉
Make it better!
Describe "Koan Bug, Issue, or Help Request"
ISSUE 1: Value to be evaluated in the Pester test was null, and type for Pester test is incorrect.
Original Line 53:
$Selected.GetType().FullName | Should -BeOfType [System.IO.Directoryinfo]
Modified Line 53:
$Folder.GetType().FullName | Should -BeOfType [System.String]
ISSUE 2: Code presented did not contain a property that would satisfy the associated Pester test.
Previous examples of $Selected contain references to a property that would satisfy the Pester test, so adding the appropriate code and using the abbreviations for Name and Element to get the code to fit with the current example is needed.
Original at line 244:
Modified at Line 244
So that the line at what is now 251 makes sense
$Selected.____ | Should -BeOfType [TimeSpan]
**ISSUE 3: ** Depending on the intent of the developer.
Given what I understand to be the intent, you may have wanted the student to explore PSCustomObject to discover how it is a System.Management.Automation.PSObject, however things were a bit ambiguous as to exactly how you wanted to have the student demonstrate that they had done the exploration. I have provide a tweak/suggestion that may prevent others from posting an issue with the code.
Original at line 297 or 298 if previous changes have been made:
[PSCustomObject] | Should -Be [System.Management.Automation.PSObject]
Modified at line 297 0r 298
Could be
[PSCustomObject].____ | Should -Be System.Management.Automation.PSObject
With the solution being
[PSCustomObject].FullName | Should -Be System.Management.Automation.PSObject
The text was updated successfully, but these errors were encountered: