Пример #1
0
        public void UnexpectedMethodCallOnReplayThrows()
        {
            MethodInfo endsWith = MethodCallTests.GetMethodInfo("EndsWith", "2");

            Assert.Throws <ExpectationViolationException>(
                "String.EndsWith(\"2\"); Expected #0, Actual #1.",
                () => replay.MethodCall(new FakeInvocation(endsWith), endsWith, "2"));
        }
Пример #2
0
        public void VerifyWhenMismatchArgsContainsNull()
        {
            MethodInfo endsWith = MethodCallTests.GetMethodInfo("EndsWith", "2");

            Assert.Throws <ExpectationViolationException>(
                "String.EndsWith(null); Expected #0, Actual #1.",
                () => replay.MethodCall(new FakeInvocation(endsWith), endsWith, new object[1] {
                null
            }));
        }
Пример #3
0
 private static MethodInfo CreateMethodInfo()
 {
     return(MethodCallTests.GetMethodInfo("StartsWith", ""));
 }