public void ShimmedMethod_Generates_From_Static_Call_Records_Multi_Parameters() { var shimmedMethod = new ShimmedMethod(typeof(StaticMethodsTestClass).GetMethod("MethodWithMultiParams")); Assert.IsNotNull(shimmedMethod); Assert.IsNotNull(shimmedMethod.Method); Assert.IsNotNull(shimmedMethod.Shim); var beforeDateTime = DateTime.Now; PoseContext.Isolate(() => { StaticMethodsTestClass.MethodWithMultiParams(5, 6, "bird", new List <bool> { true, false, true }); }, new[] { shimmedMethod.Shim }); Assert.AreEqual(1, shimmedMethod.CallResults.Count); var callResult = shimmedMethod.CallResults.First(); Assert.IsNotNull(callResult.Parameters); var afterDateTime = DateTime.Now; Assert.IsNotNull(callResult.CalledAt); Assert.IsTrue(beforeDateTime < callResult.CalledAt && callResult.CalledAt < afterDateTime); Assert.AreEqual(5, (int)callResult.Parameters[0]); Assert.AreEqual(6, (int)callResult.Parameters[1]); Assert.AreEqual("bird", (string)callResult.Parameters[2]); Assert.IsTrue(new List <bool> { true, false, true }.SequenceEqual((List <bool>)callResult.Parameters[3])); }
public void MethodWithMultiParams(int a, int b, string c, List <bool> d) { StaticMethodsTestClass.MethodWithMultiParams(a, b, c, d); }