Skip to content

Commit 7f2b369

Browse files
authored
Update New-MockObject help (#2323)
1 parent 04847c4 commit 7f2b369

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/functions/New-MockObject.ps1

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@
1212
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.
1313
1414
.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.
1616
1717
.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 }`.
1919
2020
.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 }`.
2222
2323
ScriptBlock can define param block, and it will receive arguments that were provided to the function call based on order.
2424
2525
Method overloads are not supported because ScriptMethods are used to decorate the object, and ScriptMethods do not support method overloads.
2626
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.
2828
2929
.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'.
3131
3232
.EXAMPLE
3333
```powershell
@@ -56,13 +56,13 @@
5656
5757
Call Arguments
5858
---- ---------
59-
1 {}
60-
2 {True}
61-
3 {False}
59+
1 {}
60+
2 {True}
61+
3 {False}
6262
```
6363
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`
6666
6767
.LINK
6868
https://pester.dev/docs/commands/New-MockObject

0 commit comments

Comments
 (0)