markrendle / Simple.Data

A light-weight, dynamic data access component for C# 4.0
MIT License
1.33k stars 303 forks source link

Addition to InMemoryAdapter for Output parameters #281

Closed SimonH closed 11 years ago

SimonH commented 11 years ago

Hi Mark,

I found i was unable to mock a function (or procedure) with output parameters using InMemoryAdapter because I couldn't get values into the OutputValues collection of the result.

I've altered it so that you can do this with a delegate that receives the actual parameter dictionary rather than the values array. I tried to keep the functions in a single dictionary so added FunctionInfo and FunctionFlags to persist how to call the delegate. Hoping that using Flags will make it possible to extend the metadata without too much impact in the future.

Test added for the new scenario, showing the use of the OutputValues collection.

Thanks,

Simon