-
Notifications
You must be signed in to change notification settings - Fork 45
Document Additional Types for Tests #103
Comments
I recently encountered a test where it would have been helpful to have a |
Without ever testing it, I see no reason |
I think as long as you can run ($Actual -as $Type) and it works than that type will work for that test. I have been able to test with pscustomobject, array, hastable, object, etc. Edit: Actually, you can't use pscustomobject because |
i was working on porting over the VM boot delay test. When you run this command: It shows that it is a 'Int64'. The config file doesnt seem to be able to delineate between a int32 and a int64, meaning only What I had to do was type cast my $Desired so it stored it as an 'int' |
We probably need a concept doc around this problem as discovered by @midacts - test writers need a way to figure out what types they can/can't use and considerations to keep in mind for this. |
Currently, only three types are documented in the tests/code for types consumable by json: bool, string, and int.
Expected Behavior
The available types should support arrays of string and int and perhaps other types as well.
Current Behavior
In a test you can specify
string[]
as a type but this is undocumented even though it works.Possible Solution
Decide on which types are acceptable and document them; at least document arrays.
Context
This would enable people to write better/more specific tests, especially in cases where the type should be an array of strings. This functionality already exists, it's just undocumented and people tend to assume that only documented things are possible.
Your Environment
1.0.1
10.0.14393
5.1.14393.693
The text was updated successfully, but these errors were encountered: