I have a cmdlet within a module I am testing where 3 of the 4 params are dynamically built at runtime. Within the cmdlet, I assign a new variable to the passed in value and use that variable within a custom object.
My issue is when I write the pester test and mock the dynamic param, the object I am returning doesn't get picked by the $PSboundParameters variable
I figured out mistake. It was related to what I was passing into my ParameterFilter scriptblock and what I was actually passing into the function. They didn't match so the function was not being mocked as I thought it was.
The topic ‘Pester Test with Dynamic Variables’ is closed to new replies.