示例#1
0
 private static string GetMessage(MockBehavior behavior, Invocation invocation, string message)
 {
     return(string.Format(
                CultureInfo.CurrentCulture,
                Resources.MockExceptionMessage,
                invocation.ToString(),
                behavior,
                message
                ));
 }
示例#2
0
 /// <summary>
 ///   Returns the exception to be thrown when a strict mock has no setup that provides a return value for the specified invocation.
 /// </summary>
 internal static MockException ReturnValueRequired(Invocation invocation)
 {
     return(new MockException(
                MockExceptionReason.ReturnValueRequired,
                string.Format(
                    CultureInfo.CurrentCulture,
                    Resources.MockExceptionMessage,
                    invocation.ToString(),
                    MockBehavior.Strict,
                    Resources.ReturnValueRequired)));
 }
示例#3
0
 /// <summary>
 ///   Returns the exception to be thrown when a strict mock has no setup corresponding to the specified invocation.
 /// </summary>
 internal static MockException NoSetup(Invocation invocation)
 {
     return(new MockException(
                MockExceptionReason.NoSetup,
                string.Format(
                    CultureInfo.CurrentCulture,
                    Resources.MockExceptionMessage,
                    invocation.ToString(),
                    MockBehavior.Strict,
                    Resources.NoSetup)));
 }