tonerdo / pose

Replace any .NET method (including static and non-virtual) with a delegate
MIT License
1.07k stars 75 forks source link

how to shim a constructor with parameters? #56

Open kostenray opened 4 years ago

kostenray commented 4 years ago

i see the sample : Shim ctorShim = Shim.Replace(() => new MyClass()).With(() => new MyClass() { MyProperty = 10 });

what if the constructor has input parameters, is the following correct?

Shim ctorShim = Shim.Replace(() => new MyClass(Is.A)).With((string conn) => new MyClass(conn) { });