How do I mock up an object so that I can pass it to the method that I want to test. The mocked object needs to have methods of its own that I would want to mock the output of. A simple example can be found below.
Function Method-ToTest ($obj, $value)
{
$obj.Method($value)
}
Describe “Method-ToTest” {
Mock $obj =
It “Calls tMethod to test” {
Method-ToTest $obj | Should Be $true
}
}