|
12 | 12 | The .NET type to create. This creates the object without calling any of its constructors or initializers. Use this to instantiate an object that does not have a public constructor. If your object has a constructor, or is giving you errors, try using the constructor and provide the object using the InputObject parameter to decorate it. |
13 | 13 |
|
14 | 14 | .PARAMETER InputObject |
15 | | - An already constructed object to decorate. Use New-Object or ::new to create it. |
| 15 | + An already constructed object to decorate. Use `New-Object` or `[typeName]::new()` to create it. |
16 | 16 |
|
17 | 17 | .PARAMETER Properties |
18 | | - Properties to define, specified as a hashtable, in format @{ PropertyName = value }. |
| 18 | + Properties to define, specified as a hashtable, in format `@{ PropertyName = value }`. |
19 | 19 |
|
20 | 20 | .PARAMETER Methods |
21 | | - Methods to define, specified as a hashtable, in format @{ MethodName = scriptBlock }. |
| 21 | + Methods to define, specified as a hashtable, in format `@{ MethodName = scriptBlock }`. |
22 | 22 |
|
23 | 23 | ScriptBlock can define param block, and it will receive arguments that were provided to the function call based on order. |
24 | 24 |
|
25 | 25 | Method overloads are not supported because ScriptMethods are used to decorate the object, and ScriptMethods do not support method overloads. |
26 | 26 |
|
27 | | - For each method a property named _MethodName (if using default -MethodHistoryPrefix) is defined which holds history of the invocations of the method and the arguments that were provided. |
| 27 | + For each method a property named `_MethodName` (if using default `-MethodHistoryPrefix`) is defined which holds history of the invocations of the method and the arguments that were provided. |
28 | 28 |
|
29 | 29 | .PARAMETER MethodHistoryPrefix |
30 | | - Prefix for the history-property created for each mocked method. Default is '_' which would create the property ' _MethodName'. |
| 30 | + Prefix for the history-property created for each mocked method. Default is '_' which would create the property '_MethodName'. |
31 | 31 |
|
32 | 32 | .EXAMPLE |
33 | 33 | ```powershell |
|
56 | 56 |
|
57 | 57 | Call Arguments |
58 | 58 | ---- --------- |
59 | | - 1 {} |
60 | | - 2 {True} |
61 | | - 3 {False} |
| 59 | + 1 {} |
| 60 | + 2 {True} |
| 61 | + 3 {False} |
62 | 62 | ``` |
63 | 63 |
|
64 | | - Create a mock of a process-object and mocks the object's Kill()-method. The mocked method will keep a history |
65 | | - of any call and the associated arguments in a key named <_<MethodName |
| 64 | + Create a mock of a process-object and mocks the object's `Kill()`-method. The mocked method will keep a history |
| 65 | + of any call and the associated arguments in a property named `_Kill` |
66 | 66 |
|
67 | 67 | .LINK |
68 | 68 | https://pester.dev/docs/commands/New-MockObject |
|
0 commit comments